├── .gitignore ├── .travis.yml ├── Build ├── VMware.PSDSCUnitTestsRunner.ps1 ├── build.ps1 ├── common.ps1 ├── enableExperimentalFeature.ps1 └── travis-push.sh ├── CHANGELOG.md ├── CHANGELOG_TEMPLATE.md ├── CODING_GUIDELINES.md ├── COMMITTING_GUIDELINES.md ├── CONTRIBUTING.md ├── Documentation ├── DSCResources │ ├── Cluster │ │ └── Cluster.md │ ├── DRSRule │ │ └── DRSRule.md │ ├── Datacenter │ │ └── Datacenter.md │ ├── DatacenterFolder │ │ └── DatacenterFolder.md │ ├── DatastoreCluster │ │ └── DatastoreCluster.md │ ├── DatastoreClusterAddDatastore │ │ └── DatastoreClusterAddDatastore.md │ ├── DrsCluster │ │ └── DrsCluster.md │ ├── Folder │ │ └── Folder.md │ ├── HACluster │ │ └── HACluster.md │ ├── NfsDatastore │ │ └── NfsDatastore.md │ ├── NfsUser │ │ └── NfsUser.md │ ├── PowerCLISettings │ │ └── PowerCLISettings.md │ ├── StandardPortGroup │ │ └── StandardPortGroup.md │ ├── StandardSwitch │ │ └── StandardSwitch.md │ ├── VDPortGroup │ │ └── VDPortGroup.md │ ├── VDSwitch │ │ └── VDSwitch.md │ ├── VDSwitchVMHost │ │ └── VDSwitchVMHost.md │ ├── VMHostAcceptanceLevel │ │ └── VMHostAcceptanceLevel.md │ ├── VMHostAccount │ │ └── VMHostAccount.md │ ├── VMHostAdvancedSettings │ │ └── VMHostAdvancedSettings.md │ ├── VMHostAgentVM │ │ └── VMHostAgentVM.md │ ├── VMHostAuthentication │ │ └── VMHostAuthentication.md │ ├── VMHostCache │ │ └── VMHostCache.md │ ├── VMHostConfiguration │ │ └── VMHostConfiguration.md │ ├── VMHostDCUIKeyboard │ │ └── VMHostDCUIKeyboard.md │ ├── VMHostDnsSettings │ │ └── VMHostDnsSettings.md │ ├── VMHostFirewallRuleset │ │ └── VMHostFirewallRuleset.md │ ├── VMHostGraphics │ │ └── VMHostGraphics.md │ ├── VMHostGraphicsDevice │ │ └── VMHostGraphicsDevice.md │ ├── VMHostIPRoute │ │ └── VMHostIPRoute.md │ ├── VMHostIScsiHba │ │ └── VMHostIScsiHba.md │ ├── VMHostIScsiHbaTarget │ │ └── VMHostIScsiHbaTarget.md │ ├── VMHostIScsiHbaVMKernelNic │ │ └── VMHostIScsiHbaVMKernelNic.md │ ├── VMHostNetworkCoreDump │ │ └── VMHostNetworkCoreDump.md │ ├── VMHostNtpSettings │ │ └── VMHostNtpSettings.md │ ├── VMHostPciPassthrough │ │ └── VMHostPciPassthrough.md │ ├── VMHostPermission │ │ └── VMHostPermission.md │ ├── VMHostPhysicalNic │ │ └── VMHostPhysicalNic.md │ ├── VMHostPowerPolicy │ │ └── VMHostPowerPolicy.md │ ├── VMHostRole │ │ └── VMHostRole.md │ ├── VMHostSNMPAgent │ │ └── VMHostSNMPAgent.md │ ├── VMHostSatpClaimRule │ │ └── VMHostSatpClaimRule.md │ ├── VMHostScsiLun │ │ └── VMHostScsiLun.md │ ├── VMHostScsiLunPath │ │ └── VMHostScsiLunPath.md │ ├── VMHostService │ │ └── VMHostService.md │ ├── VMHostSettings │ │ └── VMHostSettings.md │ ├── VMHostSharedSwapSpace │ │ └── VMHostSharedSwapSpace.md │ ├── VMHostSoftwareDevice │ │ └── VMHostSoftwareDevice.md │ ├── VMHostStorage │ │ └── VMHostStorage.md │ ├── VMHostSyslog │ │ └── VMHostSyslog.md │ ├── VMHostTpsSettings │ │ └── VMHostTpsSettings.md │ ├── VMHostVDSwitchMigration │ │ └── VMHostVDSwitchMigration.md │ ├── VMHostVMKernelActiveDumpFile │ │ └── VMHostVMKernelActiveDumpFile.md │ ├── VMHostVMKernelActiveDumpPartition │ │ └── VMHostVMKernelActiveDumpPartition.md │ ├── VMHostVMKernelDumpFile │ │ └── VMHostVMKernelDumpFile.md │ ├── VMHostVMKernelModule │ │ └── VMHostVMKernelModule.md │ ├── VMHostVdsNic │ │ └── VMHostVdsNic.md │ ├── VMHostVss │ │ └── VMHostVss.md │ ├── VMHostVssBridge │ │ └── VMHostVssBridge.md │ ├── VMHostVssMigration │ │ └── VMHostVssMigration.md │ ├── VMHostVssNic │ │ └── VMHostVssNic.md │ ├── VMHostVssPortGroup │ │ └── VMHostVssPortGroup.md │ ├── VMHostVssPortGroupSecurity │ │ └── VMHostVssPortGroupSecurity.md │ ├── VMHostVssPortGroupShaping │ │ └── VMHostVssPortGroupShaping.md │ ├── VMHostVssPortGroupTeaming │ │ └── VMHostVssPortGroupTeaming.md │ ├── VMHostVssSecurity │ │ └── VMHostVssSecurity.md │ ├── VMHostVssShaping │ │ └── VMHostVssShaping.md │ ├── VMHostVssTeaming │ │ └── VMHostVssTeaming.md │ ├── VMHostvSANNetworkConfiguration │ │ └── VMHostvSANNetworkConfiguration.md │ ├── VmfsDatastore │ │ └── VmfsDatastore.md │ ├── vCenterSettings │ │ └── vCenterSettings.md │ ├── vCenterStatistics │ │ └── vCenterStatistics.md │ └── vCenterVMHost │ │ └── vCenterVMHost.md ├── Tips-&-Tricks.md └── vSphereNodes.md ├── Examples ├── Inventory_Config.ps1 ├── VMHost_Authentication_Config.ps1 ├── VMHost_Config.ps1 ├── VMHost_IScsiHba_Config.ps1 ├── VMHost_NetworkMigrationToDistributedSwitch_Config.ps1 ├── VMHost_Network_Config.ps1 ├── VMHost_Storage_Config.ps1 ├── Vss_Config.ps1 └── vCenter_Config.ps1 ├── FORMATTING_GUIDELINES.md ├── LICENSE.txt ├── LIMITATIONS.md ├── NOTICE.txt ├── README.md ├── STYLE_GUIDELINES.md ├── Source ├── VMware.PSDesiredStateConfiguration │ ├── Classes │ │ ├── Private │ │ │ ├── ClassNode.ps1 │ │ │ └── ClassResolver.ps1 │ │ └── Public │ │ │ ├── BaseDscMethodResult.ps1 │ │ │ ├── CompositeResourceGetMethodResult.ps1 │ │ │ ├── Constants.ps1 │ │ │ ├── DscConfigurationBlock.ps1 │ │ │ ├── DscConfigurationBlockExtent.ps1 │ │ │ ├── DscConfigurationCompiler.ps1 │ │ │ ├── DscConfigurationFileParser.ps1 │ │ │ ├── DscConfigurationParser.ps1 │ │ │ ├── DscConfigurationRunner.ps1 │ │ │ ├── DscGetMethodResult.ps1 │ │ │ ├── DscItem.ps1 │ │ │ ├── DscKeyPropertyResourceCheck.ps1 │ │ │ ├── DscTestMethodDetailedResult.ps1 │ │ │ ├── VmwDscConfiguration.ps1 │ │ │ ├── VmwDscNode.ps1 │ │ │ ├── VmwDscResource.ps1 │ │ │ ├── VmwDscResourceGraph.ps1 │ │ │ └── VmwVsphereDscNode.ps1 │ ├── Functions │ │ ├── Private │ │ │ ├── Get-KeyPropertyResourceCheckDotNetHashCode.ps1 │ │ │ └── Invoke-VmwDscConfiguration.ps1 │ │ └── Public │ │ │ ├── Get-VmwDscConfiguration.ps1 │ │ │ ├── New-VmwDscConfiguration.ps1 │ │ │ ├── Start-VmwDscConfiguration.ps1 │ │ │ └── Test-VmwDscConfiguration.ps1 │ ├── Tests │ │ ├── Integration │ │ │ ├── Configurations │ │ │ │ └── vSphereNodeConfiguration.ps1 │ │ │ ├── Invoke-VmwDscConfiguration.Integration.Tests.ps1 │ │ │ └── ServerConfig.ps1 │ │ ├── Required Dsc Resources │ │ │ └── MyDscResource │ │ │ │ ├── DSCResources │ │ │ │ └── CompositeResourceTest │ │ │ │ │ ├── CompositeResourceTest.psd1 │ │ │ │ │ └── CompositeResourceTest.schema.psm1 │ │ │ │ ├── MyDscResource.psd1 │ │ │ │ └── MyDscResource.psm1 │ │ ├── Sample Configurations │ │ │ ├── ConfigurationData │ │ │ │ ├── AllNodes_ArrayWithNonHashtable_Value.ps1 │ │ │ │ ├── AllNodes_HashtableValue_Without_NodeNameKey.ps1 │ │ │ │ ├── AllNodes_NotAnArray.ps1 │ │ │ │ └── AllNodes_Values_With_Duplicate_NodeNameKeys.ps1 │ │ │ ├── Multiple_DSCConfigurations.ps1 │ │ │ ├── Nodes │ │ │ │ ├── manyNodes.ps1 │ │ │ │ ├── oneNodeManyConnections.ps1 │ │ │ │ └── singleNode.ps1 │ │ │ ├── compositeResourceConfig.ps1 │ │ │ ├── configurationDataConfig.ps1 │ │ │ ├── dependsOnOrder.ps1 │ │ │ ├── duplicateResources.ps1 │ │ │ ├── fileParams.ps1 │ │ │ ├── innerException.ps1 │ │ │ ├── invalidDependsOn.ps1 │ │ │ ├── manyResources.ps1 │ │ │ ├── multipleDependsOnResource.ps1 │ │ │ └── simple.ps1 │ │ ├── Unit │ │ │ ├── Invoke-VmwDscConfiguration.tests.ps1 │ │ │ └── New-VmwDscConfiguration.tests.ps1 │ │ └── Utility.ps1 │ ├── VMware.PSDesiredStateConfiguration.build.ps1 │ ├── VMware.PSDesiredStateConfiguration.psd1 │ └── VMware.PSDesiredStateConfiguration.psm1 └── VMware.vSphereDSC │ ├── Classes │ ├── BaseDSC.ps1 │ ├── BasevSphereConnection.ps1 │ ├── DatacenterInventoryBaseDSC.ps1 │ ├── DatastoreBaseDSC.ps1 │ ├── EsxCliBaseDSC.ps1 │ ├── InventoryBaseDSC.ps1 │ ├── InventoryUtil.ps1 │ ├── VMHostBaseDSC.ps1 │ ├── VMHostEntityBaseDSC.ps1 │ ├── VMHostGraphicsBaseDSC.ps1 │ ├── VMHostIScsiHbaBaseDSC.ps1 │ ├── VMHostNetworkBaseDSC.ps1 │ ├── VMHostNetworkMigrationBaseDSC.ps1 │ ├── VMHostNicBaseDSC.ps1 │ ├── VMHostRestartBaseDSC.ps1 │ ├── VMHostVssBaseDSC.ps1 │ └── VMHostVssPortGroupBaseDSC.ps1 │ ├── Configurations │ ├── Ansible │ │ ├── README.md │ │ └── vCenter_Statistics_config.yml │ ├── Chef │ │ ├── README.md │ │ ├── cluster_config.rb │ │ └── ha_cluster_config.rb │ ├── PowerShell │ │ ├── ESXiConfigs │ │ │ ├── EsxCli │ │ │ │ ├── VMHostAcceptanceLevel │ │ │ │ │ └── VMHostAcceptanceLevel_ModifyVMHostAcceptanceLevel_Config.ps1 │ │ │ │ ├── VMHostDCUIKeyboard │ │ │ │ │ └── VMHostDCUIKeyboard_ModifyVMHostDCUIKeyboardLayout_Config.ps1 │ │ │ │ ├── VMHostNetworkCoreDump │ │ │ │ │ └── VMHostNetworkCoreDump_ModifyVMHostNetworkCoreDumpConfiguration_Config.ps1 │ │ │ │ ├── VMHostSNMPAgent │ │ │ │ │ ├── VMHostSNMPAgent_ModifyVMHostSNMPAgentConfiguration_Config.ps1 │ │ │ │ │ └── VMHostSNMPAgent_ResetVMHostSNMPAgentConfiguration_Config.ps1 │ │ │ │ ├── VMHostSharedSwapSpace │ │ │ │ │ └── VMHostSharedSwapSpace_ModifySharedSwapSpaceConfiguration_Config.ps1 │ │ │ │ ├── VMHostSoftwareDevice │ │ │ │ │ ├── VMHostSoftwareDevice_AddSoftwareDevice_Config.ps1 │ │ │ │ │ └── VMHostSoftwareDevice_RemoveSoftwareDevice_Config.ps1 │ │ │ │ ├── VMHostVMKernelActiveDumpFile │ │ │ │ │ └── VMHostVMKernelActiveDumpFile_EnableVMKernelDumpFile_Config.ps1 │ │ │ │ ├── VMHostVMKernelActiveDumpPartition │ │ │ │ │ └── VMHostVMKernelActiveDumpPartition_EnableVMKernelDumpPartition_Config.ps1 │ │ │ │ ├── VMHostVMKernelDumpFile │ │ │ │ │ ├── VMHostVMKernelDumpFile_CreateVMKernelDumpFile_Config.ps1 │ │ │ │ │ └── VMHostVMKernelDumpFile_RemoveVMKernelDumpFile_Config.ps1 │ │ │ │ ├── VMHostVMKernelModule │ │ │ │ │ └── VMHostVMKernelModule_EnableVMKernelModule_Config.ps1 │ │ │ │ └── VMHostvSANNetworkConfiguration │ │ │ │ │ ├── VMHostvSANNetworkConfiguration_AddVMHostvSANNetworkConfigurationIPInterface_Config.ps1 │ │ │ │ │ └── VMHostvSANNetworkConfiguration_RemoveVMHostvSANNetworkConfigurationIPInterface_Config.ps1 │ │ │ ├── NfsDatastore │ │ │ │ ├── NfsDatastore_CreateNfsDatastoreWithReadOnlyAccessMode_Config.ps1 │ │ │ │ ├── NfsDatastore_CreateNfsDatastoreWithReadWriteAccessMode_Config.ps1 │ │ │ │ └── NfsDatastore_RemoveNfsDatastore_Config.ps1 │ │ │ ├── NfsUser │ │ │ │ ├── NfsUser_ChangeNfsUserPassword_Config.ps1 │ │ │ │ ├── NfsUser_CreateNfsUser_Config.ps1 │ │ │ │ └── NfsUser_RemoveNfsUser_Config.ps1 │ │ │ ├── StandardPortGroup │ │ │ │ ├── StandardPortGroup_Config.ps1 │ │ │ │ ├── VMHostVssPortGroupSecurity_Config.ps1 │ │ │ │ ├── VMHostVssPortGroupShaping_Config.ps1 │ │ │ │ ├── VMHostVssPortGroupTeaming_Config.ps1 │ │ │ │ └── VMHostVssPortGroup_Config.ps1 │ │ │ ├── StandardSwitch │ │ │ │ ├── StandardSwitch_Config.ps1 │ │ │ │ ├── VMHostVssBridge_Config.ps1 │ │ │ │ ├── VMHostVssSecurity_Config.ps1 │ │ │ │ ├── VMHostVssShaping_Config.ps1 │ │ │ │ ├── VMHostVssTeaming_Config.ps1 │ │ │ │ └── VMHostVss_Config.ps1 │ │ │ ├── VDSwitchVMHost_Config.ps1 │ │ │ ├── VMHostAccount_Config.ps1 │ │ │ ├── VMHostAdvancedSettings_Config.ps1 │ │ │ ├── VMHostAgentVM_Config.ps1 │ │ │ ├── VMHostAuthentication │ │ │ │ ├── VMHostAuthentication_JoinDomain_Config.ps1 │ │ │ │ └── VMHostAuthentication_LeaveDomain_Config.ps1 │ │ │ ├── VMHostCache_Config.ps1 │ │ │ ├── VMHostConfiguration │ │ │ │ ├── VMHostConfiguration_ModifyVMHostCryptoKey_Config.ps1 │ │ │ │ ├── VMHostConfiguration_ModifyVMHostHostProfileAssociation_Config.ps1 │ │ │ │ ├── VMHostConfiguration_ModifyVMHostLicenseKeyTimeZoneVMSwapfileDatastoreAndPolicy_Config.ps1 │ │ │ │ └── VMHostConfiguration_ModifyVMHostState_Config.ps1 │ │ │ ├── VMHostDnsSettings_Config.ps1 │ │ │ ├── VMHostFirewallRuleset │ │ │ │ └── VMHostFirewallRuleset_EnableVMHostFirewallRulesetAndModifyTheAllowedIPAddressesList_Config.ps1 │ │ │ ├── VMHostGraphics │ │ │ │ ├── VMHostGraphicsDevice_Config.ps1 │ │ │ │ └── VMHostGraphics_Config.ps1 │ │ │ ├── VMHostIScsiHba │ │ │ │ ├── VMHostIScsiHba_ConfigureCHAPSettingsOfIScsiHostBusAdapterWithProhibitedChapType_Config.ps1 │ │ │ │ ├── VMHostIScsiHba_ConfigureCHAPSettingsOfIScsiHostBusAdapterWithRequiredChapType_Config.ps1 │ │ │ │ └── VMHostIScsiHba_ModifyIScsiNameOfIScsiHostBusAdapter_Config.ps1 │ │ │ ├── VMHostIScsiHbaTarget │ │ │ │ ├── VMHostIScsiHbaTarget_CreateIScsiHostBusAdapterSendTargetWithRequiredChapType_Config.ps1 │ │ │ │ ├── VMHostIScsiHbaTarget_CreateIScsiHostBusAdapterStaticTargetWithInheritedChapSettings_Config.ps1 │ │ │ │ └── VMHostIScsiHbaTarget_RemoveIScsiHostBusAdapterSendTarget_Config.ps1 │ │ │ ├── VMHostIScsiHbaVMKernelNic │ │ │ │ ├── VMHostIScsiHbaVMKernelNic_BindVMKernelNicsToIscsiHba_Config.ps1 │ │ │ │ └── VMHostIScsiHbaVMKernelNic_UnbindVMKernelNicsToIscsiHba_Config.ps1 │ │ │ ├── VMHostNetwork │ │ │ │ ├── VMHostIPRoute │ │ │ │ │ ├── VMHostIPRoute_CreateVMHostIPRoute_Config.ps1 │ │ │ │ │ └── VMHostIPRoute_RemoveVMHostIPRoute_Config.ps1 │ │ │ │ ├── VMHostNetworkMigration │ │ │ │ │ ├── VMHostVDSwitchMigration │ │ │ │ │ │ ├── VMHostVDSwitchMigration_MigratePhysicalNicsAndVMKernelNicsAttachedToDifferentPortGroups_Config.ps1 │ │ │ │ │ │ ├── VMHostVDSwitchMigration_MigratePhysicalNicsAndVMKernelNicsAttachedToTheSamePortGroup_Config.ps1 │ │ │ │ │ │ └── VMHostVDSwitchMigration_MigratePhysicalNics_Config.ps1 │ │ │ │ │ └── VMHostVssMigration │ │ │ │ │ │ ├── VMHostVssMigration_MigratePhysicalNicsAndVMKernelNicsWithPortGroups_Config.ps1 │ │ │ │ │ │ ├── VMHostVssMigration_MigratePhysicalNicsAndVMKernelNics_Config.ps1 │ │ │ │ │ │ └── VMHostVssMigration_MigratePhysicalNics_Config.ps1 │ │ │ │ └── VMHostNic │ │ │ │ │ ├── VMHostPhysicalNic_Config.ps1 │ │ │ │ │ ├── VMHostVdsNic │ │ │ │ │ ├── VMHostVdsNic_EnableAvailableServices_Config.ps1 │ │ │ │ │ └── VMHostVdsNic_RemoveVMKernelNic_Config.ps1 │ │ │ │ │ └── VMHostVssNic_Config.ps1 │ │ │ ├── VMHostNtpSettings_Config.ps1 │ │ │ ├── VMHostPciPassthrough_Config.ps1 │ │ │ ├── VMHostPermission │ │ │ │ ├── VMHostPermission_CreateVMHostPermissionForDatacenterEntity_Config.ps1 │ │ │ │ ├── VMHostPermission_CreateVMHostPermissionForDatastoreEntity_Config.ps1 │ │ │ │ ├── VMHostPermission_CreateVMHostPermissionForResourcePoolEntity_Config.ps1 │ │ │ │ ├── VMHostPermission_CreateVMHostPermissionForVMEntity_Config.ps1 │ │ │ │ ├── VMHostPermission_CreateVMHostPermissionForVMHostEntity_Config.ps1 │ │ │ │ └── VMHostPermission_RemoveVMHostPermission_Config.ps1 │ │ │ ├── VMHostPowerPolicy_Config.ps1 │ │ │ ├── VMHostRole │ │ │ │ ├── VMHostRole_CreateRoleWithPrivileges_Config.ps1 │ │ │ │ └── VMHostRole_RemoveRole_Config.ps1 │ │ │ ├── VMHostSatpClaimRule_Config.ps1 │ │ │ ├── VMHostScsiLun │ │ │ │ ├── VMHostScsiLun_ModifyVMHostScsiLunConfigurationWithFixedMultipathPolicy_Config.ps1 │ │ │ │ ├── VMHostScsiLun_ModifyVMHostScsiLunConfigurationWithRoundRobinMultipathPolicy_Config.ps1 │ │ │ │ └── VMHostScsiLun_RemoveScsiDiskPartitions_Config.ps1 │ │ │ ├── VMHostScsiLunPath │ │ │ │ └── VMHostScsiLunPath_ConfigureScsiLunPathToBeActiveAndPreferred_Config.ps1 │ │ │ ├── VMHostService_Config.ps1 │ │ │ ├── VMHostSettings_Config.ps1 │ │ │ ├── VMHostStorage │ │ │ │ └── VMHostStorage_EnableSoftwareIscsi_Config.ps1 │ │ │ ├── VMHostSyslog_Config.ps1 │ │ │ ├── VMHostTpsSettings_Config.ps1 │ │ │ └── VmfsDatastore │ │ │ │ ├── VmfsDatastore_CreateVmfsDatastore_Config.ps1 │ │ │ │ └── VmfsDatastore_RemoveVmfsDatastore_Config.ps1 │ │ ├── PowerCLISettingsConfigs │ │ │ └── PowerCLISettings_Config.ps1 │ │ └── vCenterConfigs │ │ │ ├── Cluster │ │ │ ├── Cluster_Config.ps1 │ │ │ ├── DrsCluster_Config.ps1 │ │ │ └── HACluster_Config.ps1 │ │ │ ├── DRSRule │ │ │ ├── DRSRule_CreateDRSRule_Config.ps1 │ │ │ └── DRSRule_RemoveDRSRule_Config.ps1 │ │ │ ├── DatacenterFolder_Config.ps1 │ │ │ ├── Datacenter_Config.ps1 │ │ │ ├── DatastoreCluster │ │ │ ├── DatastoreCluster_CreateDatastoreCluster_Config.ps1 │ │ │ └── DatastoreCluster_RemoveDatastoreCluster_Config.ps1 │ │ │ ├── DatastoreClusterAddDatastore │ │ │ └── DatastoreClusterAddDatastore_AddDatastoresToDatastoreCluster_Config.ps1 │ │ │ ├── Folder_Config.ps1 │ │ │ ├── VDPortGroup │ │ │ ├── VDPortGroup_CreateVDPortGroupViaReferenceVDPortGroup_Config.ps1 │ │ │ ├── VDPortGroup_CreateVDPortGroup_Config.ps1 │ │ │ └── VDPortGroup_RemoveVDPortGroup_Config.ps1 │ │ │ ├── VDSwitch_Config.ps1 │ │ │ ├── vCenterSettings_Config.ps1 │ │ │ ├── vCenterStatistics_Config.ps1 │ │ │ └── vCenterVMHost │ │ │ ├── vCenterVMHost_AddVMHostTovCenterAndImportResourcePoolHierarchy_Config.ps1 │ │ │ ├── vCenterVMHost_AddVMHostTovCenter_Config.ps1 │ │ │ └── vCenterVMHost_RemoveVMHostFromvCenter_Config.ps1 │ └── Puppet │ │ ├── README.md │ │ └── vcenter_settings_config.pp │ ├── DSCResources │ ├── Cluster │ │ ├── Cluster.psd1 │ │ ├── Cluster.schema.psm1 │ │ ├── DrsCluster.ps1 │ │ └── HACluster.ps1 │ ├── DRSRule.ps1 │ ├── Datacenter.ps1 │ ├── DatacenterFolder.ps1 │ ├── Datastore │ │ ├── NfsDatastore.ps1 │ │ └── VmfsDatastore.ps1 │ ├── DatastoreCluster.ps1 │ ├── DatastoreClusterAddDatastore.ps1 │ ├── EsxCli │ │ ├── VMHostAcceptanceLevel.ps1 │ │ ├── VMHostDCUIKeyboard.ps1 │ │ ├── VMHostNetworkCoreDump.ps1 │ │ ├── VMHostSNMPAgent.ps1 │ │ ├── VMHostSharedSwapSpace.ps1 │ │ ├── VMHostSoftwareDevice.ps1 │ │ ├── VMHostVMKernelActiveDumpFile.ps1 │ │ ├── VMHostVMKernelActiveDumpPartition.ps1 │ │ ├── VMHostVMKernelDumpFile.ps1 │ │ ├── VMHostVMKernelModule.ps1 │ │ └── VMHostvSANNetworkConfiguration.ps1 │ ├── Folder.ps1 │ ├── NfsUser.ps1 │ ├── PowerCLISettings.ps1 │ ├── StandardPortGroup │ │ ├── StandardPortGroup.psd1 │ │ ├── StandardPortGroup.schema.psm1 │ │ ├── VMHostVssPortGroup.ps1 │ │ ├── VMHostVssPortGroupSecurity.ps1 │ │ ├── VMHostVssPortGroupShaping.ps1 │ │ └── VMHostVssPortGroupTeaming.ps1 │ ├── StandardSwitch │ │ ├── StandardSwitch.psd1 │ │ ├── StandardSwitch.schema.psm1 │ │ ├── VMHostVss.ps1 │ │ ├── VMHostVssBridge.ps1 │ │ ├── VMHostVssSecurity.ps1 │ │ ├── VMHostVssShaping.ps1 │ │ └── VMHostVssTeaming.ps1 │ ├── VDPortGroup.ps1 │ ├── VDSwitch.ps1 │ ├── VDSwitchVMHost.ps1 │ ├── VMHostAccount.ps1 │ ├── VMHostAdvancedSettings.ps1 │ ├── VMHostAgentVM.ps1 │ ├── VMHostAuthentication.ps1 │ ├── VMHostCache.ps1 │ ├── VMHostConfiguration.ps1 │ ├── VMHostDnsSettings.ps1 │ ├── VMHostFirewallRuleset.ps1 │ ├── VMHostGraphics │ │ ├── VMHostGraphics.ps1 │ │ └── VMHostGraphicsDevice.ps1 │ ├── VMHostIScsiHba.ps1 │ ├── VMHostIScsiHbaTarget.ps1 │ ├── VMHostIScsiHbaVMKernelNic.ps1 │ ├── VMHostNetwork │ │ ├── VMHostIPRoute │ │ │ └── VMHostIPRoute.ps1 │ │ ├── VMHostNetworkMigration │ │ │ ├── VMHostVDSwitchMigration.ps1 │ │ │ └── VMHostVssMigration.ps1 │ │ └── VMHostNic │ │ │ ├── VMHostPhysicalNic.ps1 │ │ │ ├── VMHostVdsNic.ps1 │ │ │ └── VMHostVssNic.ps1 │ ├── VMHostNtpSettings.ps1 │ ├── VMHostPciPassthrough.ps1 │ ├── VMHostPermission.ps1 │ ├── VMHostPowerPolicy.ps1 │ ├── VMHostRole.ps1 │ ├── VMHostSatpClaimRule.ps1 │ ├── VMHostScsiLun.ps1 │ ├── VMHostScsiLunPath.ps1 │ ├── VMHostService.ps1 │ ├── VMHostSettings.ps1 │ ├── VMHostStorage.ps1 │ ├── VMHostSyslog.ps1 │ ├── VMHostTpsSettings.ps1 │ ├── vCenterSettings.ps1 │ ├── vCenterStatistics.ps1 │ └── vCenterVMHost.ps1 │ ├── Enums │ ├── AcceptanceLevel.ps1 │ ├── ChapType.ps1 │ ├── Cluster │ │ ├── DrsAutomationLevel.ps1 │ │ ├── HAIsolationResponse.ps1 │ │ └── HARestartPriority.ps1 │ ├── DRSRuleType.ps1 │ ├── Datastore │ │ ├── AccessMode.ps1 │ │ └── AuthenticationMethod.ps1 │ ├── DomainAction.ps1 │ ├── Duplex.ps1 │ ├── Ensure.ps1 │ ├── EntityType.ps1 │ ├── FolderType.ps1 │ ├── GraphicsType.ps1 │ ├── IScsiHbaTargetType.ps1 │ ├── LinkDiscovertProtocolOperation.ps1 │ ├── LinkDiscoveryProtocolProtocol.ps1 │ ├── LoadBalancingPolicy.ps1 │ ├── LoggingLevel.ps1 │ ├── MultipathPolicy.ps1 │ ├── NetworkFailoverDetectionPolicy.ps1 │ ├── Period.ps1 │ ├── PortBinding.ps1 │ ├── PowerCLISettings │ │ ├── BadCertificateAction.ps1 │ │ ├── DefaultVIServerMode.ps1 │ │ ├── PowerCLISettingsScope.ps1 │ │ └── ProxyPolicy.ps1 │ ├── PowerPolicy.ps1 │ ├── ServicePolicy.ps1 │ ├── SharedPassthruAssignmentPolicy.ps1 │ ├── VMHostState.ps1 │ ├── VMHostVss │ │ └── NicTeamingPolicy.ps1 │ ├── VMSwapfilePolicy.ps1 │ └── VsanDataMigrationMode.ps1 │ ├── ExportVMHostConfiguration.ps1 │ ├── RequiredModules.ps1 │ ├── Tests │ ├── Integration │ │ ├── Cluster │ │ │ ├── DrsCluster.Integration.Tests.ps1 │ │ │ └── HACluster.Integration.Tests.ps1 │ │ ├── Configurations │ │ │ ├── Datacenter │ │ │ │ └── Datacenter_Config.ps1 │ │ │ ├── DatacenterFolder │ │ │ │ └── DatacenterFolder_Config.ps1 │ │ │ ├── DrsCluster │ │ │ │ └── DrsCluster_Config.ps1 │ │ │ ├── Folder │ │ │ │ └── Folder_Config.ps1 │ │ │ ├── HACluster │ │ │ │ └── HACluster_Config.ps1 │ │ │ ├── NfsDatastore │ │ │ │ └── NfsDatastore_Config.ps1 │ │ │ ├── NfsUser │ │ │ │ └── NfsUser_Config.ps1 │ │ │ ├── PowerCLISettings │ │ │ │ └── PowerCLISettings_Config.ps1 │ │ │ ├── VDPortGroup │ │ │ │ └── VDPortGroup_Config.ps1 │ │ │ ├── VDSwitch │ │ │ │ └── VDSwitch_Config.ps1 │ │ │ ├── VDSwitchVMHost │ │ │ │ └── VDSwitchVMHost_Config.ps1 │ │ │ ├── VMHostAcceptanceLevel │ │ │ │ └── VMHostAcceptanceLevel_Config.ps1 │ │ │ ├── VMHostAccount │ │ │ │ └── VMHostAccount_Config.ps1 │ │ │ ├── VMHostAdvancedSettings │ │ │ │ └── VMHostAdvancedSettings_Config.ps1 │ │ │ ├── VMHostAgentVM │ │ │ │ └── VMHostAgentVM_Config.ps1 │ │ │ ├── VMHostAuthentication │ │ │ │ └── VMHostAuthentication_Config.ps1 │ │ │ ├── VMHostCache │ │ │ │ └── VMHostCache_Config.ps1 │ │ │ ├── VMHostConfiguration │ │ │ │ └── VMHostConfiguration_Config.ps1 │ │ │ ├── VMHostDCUIKeyboard │ │ │ │ └── VMHostDCUIKeyboard_Config.ps1 │ │ │ ├── VMHostDnsSettings │ │ │ │ └── VMHostDnsSettings_Config.ps1 │ │ │ ├── VMHostFirewallRuleset │ │ │ │ └── VMHostFirewallRuleset_Config.ps1 │ │ │ ├── VMHostGraphics │ │ │ │ └── VMHostGraphics_Config.ps1 │ │ │ ├── VMHostGraphicsDevice │ │ │ │ └── VMHostGraphicsDevice_Config.ps1 │ │ │ ├── VMHostIPRoute │ │ │ │ └── VMHostIPRoute_Config.ps1 │ │ │ ├── VMHostIScsiHba │ │ │ │ └── VMHostIScsiHba_Config.ps1 │ │ │ ├── VMHostIScsiHbaTarget │ │ │ │ └── VMHostIScsiHbaTarget_Config.ps1 │ │ │ ├── VMHostNetworkCoreDump │ │ │ │ └── VMHostNetworkCoreDump_Config.ps1 │ │ │ ├── VMHostNtpSettings │ │ │ │ └── VMHostNtpSettings_Config.ps1 │ │ │ ├── VMHostPciPassthrough │ │ │ │ └── VMHostPciPassthrough_Config.ps1 │ │ │ ├── VMHostPermission │ │ │ │ └── VMHostPermission_Config.ps1 │ │ │ ├── VMHostPhysicalNic │ │ │ │ └── VMHostPhysicalNic_Config.ps1 │ │ │ ├── VMHostPowerPolicy │ │ │ │ └── VMHostPowerPolicy_Config.ps1 │ │ │ ├── VMHostRole │ │ │ │ └── VMHostRole_Config.ps1 │ │ │ ├── VMHostSNMPAgent │ │ │ │ └── VMHostSNMPAgent_Config.ps1 │ │ │ ├── VMHostSatpClaimRule │ │ │ │ └── VMHostSatpClaimRule_Config.ps1 │ │ │ ├── VMHostScsiLun │ │ │ │ └── VMHostScsiLun_Config.ps1 │ │ │ ├── VMHostScsiLunPath │ │ │ │ └── VMHostScsiLunPath_Config.ps1 │ │ │ ├── VMHostService │ │ │ │ └── VMHostService_Config.ps1 │ │ │ ├── VMHostSettings │ │ │ │ └── VMHostSettings_Config.ps1 │ │ │ ├── VMHostSharedSwapSpace │ │ │ │ └── VMHostSharedSwapSpace_Config.ps1 │ │ │ ├── VMHostSoftwareDevice │ │ │ │ └── VMHostSoftwareDevice_Config.ps1 │ │ │ ├── VMHostSyslog │ │ │ │ └── VMHostSyslog_Config.ps1 │ │ │ ├── VMHostTpsSettings │ │ │ │ └── VMHostTpsSettings_Config.ps1 │ │ │ ├── VMHostVDSwitchMigration │ │ │ │ └── VMHostVDSwitchMigration_Config.ps1 │ │ │ ├── VMHostVMKernelActiveDumpFile │ │ │ │ └── VMHostVMKernelActiveDumpFile_Config.ps1 │ │ │ ├── VMHostVMKernelActiveDumpPartition │ │ │ │ └── VMHostVMKernelActiveDumpPartition_Config.ps1 │ │ │ ├── VMHostVMKernelDumpFile │ │ │ │ └── VMHostVMKernelDumpFile_Config.ps1 │ │ │ ├── VMHostVMKernelModule │ │ │ │ └── VMHostVMKernelModule_Config.ps1 │ │ │ ├── VMHostVss │ │ │ │ └── VMHostVss_Config.ps1 │ │ │ ├── VMHostVssBridge │ │ │ │ └── VMHostVssBridge_Config.ps1 │ │ │ ├── VMHostVssMigration │ │ │ │ └── VMHostVssMigration_Config.ps1 │ │ │ ├── VMHostVssNic │ │ │ │ └── VMHostVssNic_Config.ps1 │ │ │ ├── VMHostVssPortGroup │ │ │ │ └── VMHostVssPortGroup_Config.ps1 │ │ │ ├── VMHostVssPortGroupSecurity │ │ │ │ └── VMHostVssPortGroupSecurity_Config.ps1 │ │ │ ├── VMHostVssPortGroupShaping │ │ │ │ └── VMHostVssPortGroupShaping_Config.ps1 │ │ │ ├── VMHostVssPortGroupTeaming │ │ │ │ └── VMHostVssPortGroupTeaming_Config.ps1 │ │ │ ├── VMHostVssSecurity │ │ │ │ └── VMHostVssSecurity_Config.ps1 │ │ │ ├── VMHostVssShaping │ │ │ │ └── VMHostVssShaping_Config.ps1 │ │ │ ├── VMHostVssTeaming │ │ │ │ └── VMHostVssTeaming_Config.ps1 │ │ │ ├── VMHostvSANNetworkConfiguration │ │ │ │ └── VMHostvSANNetworkConfiguration_Config.ps1 │ │ │ ├── VmfsDatastore │ │ │ │ └── VmfsDatastore_Config.ps1 │ │ │ ├── vCenterSettings │ │ │ │ └── vCenterSettings_Config.ps1 │ │ │ ├── vCenterStatistics │ │ │ │ └── vCenterStatistics_Config.ps1 │ │ │ └── vCenterVMHost │ │ │ │ └── vCenterVMHost_Config.ps1 │ │ ├── DRSRule │ │ │ ├── DRSRule.Integration.Tests.Helpers.ps1 │ │ │ ├── DRSRule.Integration.Tests.ps1 │ │ │ └── DRSRule_Config.ps1 │ │ ├── Datacenter.Integration.Tests.ps1 │ │ ├── DatacenterFolder.Integration.Tests.ps1 │ │ ├── Datastore │ │ │ ├── NfsDatastore.Integration.Tests.ps1 │ │ │ └── VmfsDatastore.Integration.Tests.ps1 │ │ ├── DatastoreCluster │ │ │ ├── DatastoreCluster.Integration.Tests.ps1 │ │ │ └── DatastoreCluster_Config.ps1 │ │ ├── DatastoreClusterAddDatastore │ │ │ ├── DatastoreClusterAddDatastore.Integration.Tests.Helpers.ps1 │ │ │ ├── DatastoreClusterAddDatastore.Integration.Tests.ps1 │ │ │ └── DatastoreClusterAddDatastore_Config.ps1 │ │ ├── EsxCli │ │ │ ├── VMHostAcceptanceLevel │ │ │ │ ├── VMHostAcceptanceLevel.Integration.Tests.Helpers.ps1 │ │ │ │ └── VMHostAcceptanceLevel.Integration.Tests.ps1 │ │ │ ├── VMHostDCUIKeyboard │ │ │ │ ├── VMHostDCUIKeyboard.Integration.Tests.Helpers.ps1 │ │ │ │ └── VMHostDCUIKeyboard.Integration.Tests.ps1 │ │ │ ├── VMHostNetworkCoreDump │ │ │ │ ├── VMHostNetworkCoreDump.Integration.Tests.Helpers.ps1 │ │ │ │ └── VMHostNetworkCoreDump.Integration.Tests.ps1 │ │ │ ├── VMHostSNMPAgent │ │ │ │ ├── VMHostSNMPAgent.Integration.Tests.Helpers.ps1 │ │ │ │ └── VMHostSNMPAgent.Integration.Tests.ps1 │ │ │ ├── VMHostSharedSwapSpace │ │ │ │ ├── VMHostSharedSwapSpace.Integration.Tests.Helpers.ps1 │ │ │ │ └── VMHostSharedSwapSpace.Integration.Tests.ps1 │ │ │ ├── VMHostSoftwareDevice │ │ │ │ └── VMHostSoftwareDevice.Integration.Tests.ps1 │ │ │ ├── VMHostVMKernelActiveDumpFile │ │ │ │ ├── VMHostVMKernelActiveDumpFile.Integration.Tests.Helpers.ps1 │ │ │ │ └── VMHostVMKernelActiveDumpFile.Integration.Tests.ps1 │ │ │ ├── VMHostVMKernelActiveDumpPartition │ │ │ │ ├── VMHostVMKernelActiveDumpPartition.Integration.Tests.Helpers.ps1 │ │ │ │ └── VMHostVMKernelActiveDumpPartition.Integration.Tests.ps1 │ │ │ ├── VMHostVMKernelDumpFile │ │ │ │ ├── VMHostVMKernelDumpFile.Integration.Tests.Helpers.ps1 │ │ │ │ └── VMHostVMKernelDumpFile.Integration.Tests.ps1 │ │ │ ├── VMHostVMKernelModule │ │ │ │ ├── VMHostVMKernelModule.Integration.Tests.Helpers.ps1 │ │ │ │ └── VMHostVMKernelModule.Integration.Tests.ps1 │ │ │ └── VMHostvSANNetworkConfiguration │ │ │ │ ├── VMHostvSANNetworkConfiguration.Integration.Tests.Helpers.ps1 │ │ │ │ └── VMHostvSANNetworkConfiguration.Integration.Tests.ps1 │ │ ├── Folder.Integration.Tests.ps1 │ │ ├── NfsUser.Integration.Tests.ps1 │ │ ├── PowerCLISettings.Integration.Tests.ps1 │ │ ├── TestHelpers │ │ │ └── IntegrationTests.Constants.ps1 │ │ ├── VDPortGroup.Integration.Tests.ps1 │ │ ├── VDSwitch.Integration.Tests.ps1 │ │ ├── VDSwitchVMHost.Integration.Tests.ps1 │ │ ├── VMHostAccount.Integration.Tests.ps1 │ │ ├── VMHostAdvancedSettings.Integration.Tests.ps1 │ │ ├── VMHostAgentVM.Integration.Tests.ps1 │ │ ├── VMHostAuthentication.Integration.Tests.ps1 │ │ ├── VMHostCache.Integration.Tests.ps1 │ │ ├── VMHostConfiguration │ │ │ ├── VMHostConfiguration.Integration.Tests.Helpers.ps1 │ │ │ └── VMHostConfiguration.Integration.Tests.ps1 │ │ ├── VMHostDnsSettings.Integration.Tests.ps1 │ │ ├── VMHostFirewallRuleset │ │ │ ├── VMHostFirewallRuleset.Integration.Tests.Helpers.ps1 │ │ │ └── VMHostFirewallRuleset.Integration.Tests.ps1 │ │ ├── VMHostGraphics │ │ │ ├── VMHostGraphics.Integration.Tests.ps1 │ │ │ └── VMHostGraphicsDevice.Integration.Tests.ps1 │ │ ├── VMHostIScsiHba │ │ │ ├── VMHostIScsiHba.Integration.Tests.Helpers.ps1 │ │ │ └── VMHostIScsiHba.Integration.Tests.ps1 │ │ ├── VMHostIScsiHbaTarget │ │ │ ├── VMHostIScsiHbaTarget.Integration.Tests.Helpers.ps1 │ │ │ └── VMHostIScsiHbaTarget.Integration.Tests.ps1 │ │ ├── VMHostIScsiHbaVMKernelNic │ │ │ ├── VMHostIScsiHbaVMKernelNic.Integration.Tests.Helpers.ps1 │ │ │ ├── VMHostIScsiHbaVMKernelNic.Integration.Tests.ps1 │ │ │ └── VMHostIScsiHbaVMKernelNic_Config.ps1 │ │ ├── VMHostNetwork │ │ │ ├── VMHostIPRoute │ │ │ │ ├── VMHostIPRoute.Integration.Tests.Helpers.ps1 │ │ │ │ └── VMHostIPRoute.Integration.Tests.ps1 │ │ │ ├── VMHostNetworkMigration │ │ │ │ ├── VMHostNetworkMigration.Integration.Tests.Helpers.ps1 │ │ │ │ ├── VMHostVDSwitchMigration.Integration.Tests.ps1 │ │ │ │ └── VMHostVssMigration.Integration.Tests.ps1 │ │ │ ├── VMHostNic │ │ │ │ ├── VMHostPhysicalNic.Integration.Tests.ps1 │ │ │ │ ├── VMHostVdsNic │ │ │ │ │ ├── VMHostVdsNic.Integration.Tests.Helpers.ps1 │ │ │ │ │ ├── VMHostVdsNic.Integration.Tests.ps1 │ │ │ │ │ └── VMHostVdsNic_Config.ps1 │ │ │ │ └── VMHostVssNic.Integration.Tests.ps1 │ │ │ └── VMHostVssPortGroup │ │ │ │ ├── VMHostVssPortGroup.Integration.Tests.ps1 │ │ │ │ ├── VMHostVssPortGroupSecurity.Integration.Tests.ps1 │ │ │ │ ├── VMHostVssPortGroupShaping.Integration.Tests.ps1 │ │ │ │ └── VMHostVssPortGroupTeaming.Integration.Tests.ps1 │ │ ├── VMHostNtpSettings.Integration.Tests.ps1 │ │ ├── VMHostPciPassthrough.Integration.Tests.ps1 │ │ ├── VMHostPermission │ │ │ ├── VMHostPermission.Integration.Tests.Helpers.ps1 │ │ │ └── VMHostPermission.Integration.Tests.ps1 │ │ ├── VMHostPowerPolicy.Integration.Tests.ps1 │ │ ├── VMHostRole.Integration.Tests.ps1 │ │ ├── VMHostSatpClaimRule.Integration.Tests.ps1 │ │ ├── VMHostScsiLun │ │ │ ├── VMHostScsiLun.Integration.Tests.Helpers.ps1 │ │ │ └── VMHostScsiLun.Integration.Tests.ps1 │ │ ├── VMHostScsiLunPath │ │ │ ├── VMHostScsiLunPath.Integration.Tests.Helpers.ps1 │ │ │ └── VMHostScsiLunPath.Integration.Tests.ps1 │ │ ├── VMHostService.Integration.Tests.ps1 │ │ ├── VMHostSettings.Integration.Tests.ps1 │ │ ├── VMHostStorage │ │ │ ├── VMHostStorage.Integration.Tests.Helpers.ps1 │ │ │ ├── VMHostStorage.Integration.Tests.ps1 │ │ │ └── VMHostStorage_Config.ps1 │ │ ├── VMHostSyslog.Integration.Tests.ps1 │ │ ├── VMHostTpsSettings.Integration.Tests.ps1 │ │ ├── VMHostVss │ │ │ ├── VMHostVss.Integration.Tests.ps1 │ │ │ ├── VMHostVssBridge.Integration.Tests.ps1 │ │ │ ├── VMHostVssSecurity.Integration.Tests.ps1 │ │ │ ├── VMHostVssShaping.Integration.Tests.ps1 │ │ │ └── VMHostVssTeaming.Integration.Tests.ps1 │ │ ├── vCenterSettings.Integration.Tests.ps1 │ │ ├── vCenterStatistics.Integration.Tests.ps1 │ │ └── vCenterVMHost │ │ │ ├── vCenterVMHost.Integration.Tests.Helpers.ps1 │ │ │ └── vCenterVMHost.Integration.Tests.ps1 │ ├── IntegrationTests.ps1 │ ├── TestRunner.ps1 │ ├── Unit │ │ ├── BaseDSC.Unit.Tests.ps1 │ │ ├── Cluster │ │ │ ├── DrsCluster.Unit.Tests.ps1 │ │ │ └── HACluster.Unit.Tests.ps1 │ │ ├── Compare-Settings.Unit.Tests.ps1 │ │ ├── DRSRule │ │ │ ├── DRSRule.Mocks.Data.ps1 │ │ │ ├── DRSRule.Mocks.ps1 │ │ │ └── DRSRule.Unit.Tests.ps1 │ │ ├── Datacenter.Unit.Tests.ps1 │ │ ├── DatacenterFolder.Unit.Tests.ps1 │ │ ├── DatacenterInventoryBaseDSC.Unit.Tests.ps1 │ │ ├── Datastore │ │ │ ├── DatastoreBaseDSC.Unit.Tests.ps1 │ │ │ ├── NfsDatastore.Unit.Tests.ps1 │ │ │ └── VmfsDatastore.Unit.Tests.ps1 │ │ ├── DatastoreCluster │ │ │ ├── DatastoreCluster.Mocks.Data.ps1 │ │ │ ├── DatastoreCluster.Mocks.ps1 │ │ │ └── DatastoreCluster.Unit.Tests.ps1 │ │ ├── DatastoreClusterAddDatastore │ │ │ ├── DatastoreClusterAddDatastore.Mocks.Data.ps1 │ │ │ ├── DatastoreClusterAddDatastore.Mocks.ps1 │ │ │ └── DatastoreClusterAddDatastore.Unit.Tests.ps1 │ │ ├── EsxCli │ │ │ ├── EsxCliBaseDSC.Unit.Tests.ps1 │ │ │ ├── VMHostAcceptanceLevel.Unit.Tests.ps1 │ │ │ ├── VMHostDCUIKeyboard.Unit.Tests.ps1 │ │ │ ├── VMHostNetworkCoreDump.Unit.Tests.ps1 │ │ │ ├── VMHostSNMPAgent.Unit.Tests.ps1 │ │ │ ├── VMHostSharedSwapSpace.Unit.Tests.ps1 │ │ │ ├── VMHostSoftwareDevice.Unit.Tests.ps1 │ │ │ ├── VMHostVMKernelActiveDumpFile.Unit.Tests.ps1 │ │ │ ├── VMHostVMKernelActiveDumpPartition.Unit.Tests.ps1 │ │ │ ├── VMHostVMKernelDumpFile.Unit.Tests.ps1 │ │ │ ├── VMHostVMKernelModule.Unit.Tests.ps1 │ │ │ └── VMHostvSANNetworkConfiguration.Unit.Tests.ps1 │ │ ├── Folder.Unit.Tests.ps1 │ │ ├── InventoryBaseDSC.Unit.Tests.ps1 │ │ ├── NfsUser.Unit.Tests.ps1 │ │ ├── PowerCLISettings.Unit.Tests.ps1 │ │ ├── TestHelpers │ │ │ ├── Mocks │ │ │ │ ├── BaseDSCMocks.ps1 │ │ │ │ ├── DatacenterFolderMocks.ps1 │ │ │ │ ├── DatacenterInventoryBaseDSCMocks.ps1 │ │ │ │ ├── DatacenterMocks.ps1 │ │ │ │ ├── DatastoreBaseDSCMocks.ps1 │ │ │ │ ├── DrsClusterMocks.ps1 │ │ │ │ ├── EsxCliBaseDSCMocks.ps1 │ │ │ │ ├── FolderMocks.ps1 │ │ │ │ ├── HAClusterMocks.ps1 │ │ │ │ ├── InventoryBaseDSCMocks.ps1 │ │ │ │ ├── MockData.ps1 │ │ │ │ ├── NfsDatastoreMocks.ps1 │ │ │ │ ├── NfsUserMocks.ps1 │ │ │ │ ├── VDPortGroupMocks.ps1 │ │ │ │ ├── VDSwitchMocks.ps1 │ │ │ │ ├── VDSwitchVMHostMocks.ps1 │ │ │ │ ├── VMHostAcceptanceLevelMocks.ps1 │ │ │ │ ├── VMHostAdvancedSettingsMocks.ps1 │ │ │ │ ├── VMHostAgentVMMocks.ps1 │ │ │ │ ├── VMHostAuthenticationMocks.ps1 │ │ │ │ ├── VMHostCacheMocks.ps1 │ │ │ │ ├── VMHostConfigurationMocks.ps1 │ │ │ │ ├── VMHostDCUIKeyboardMocks.ps1 │ │ │ │ ├── VMHostFirewallRulesetMocks.ps1 │ │ │ │ ├── VMHostGraphicsDeviceMocks.ps1 │ │ │ │ ├── VMHostGraphicsMocks.ps1 │ │ │ │ ├── VMHostIPRouteMocks.ps1 │ │ │ │ ├── VMHostIScsiHbaBaseDSCMocks.ps1 │ │ │ │ ├── VMHostIScsiHbaMocks.ps1 │ │ │ │ ├── VMHostIScsiHbaTargetMocks.ps1 │ │ │ │ ├── VMHostNetworkCoreDumpMocks.ps1 │ │ │ │ ├── VMHostNicBaseDSCMocks.ps1 │ │ │ │ ├── VMHostPciPassthroughMocks.ps1 │ │ │ │ ├── VMHostPermissionMocks.ps1 │ │ │ │ ├── VMHostPhysicalNicMocks.ps1 │ │ │ │ ├── VMHostPowerPolicyMocks.ps1 │ │ │ │ ├── VMHostRoleMocks.ps1 │ │ │ │ ├── VMHostSNMPAgentMocks.ps1 │ │ │ │ ├── VMHostScsiLunMocks.ps1 │ │ │ │ ├── VMHostScsiLunPathMocks.ps1 │ │ │ │ ├── VMHostSharedSwapSpaceMocks.ps1 │ │ │ │ ├── VMHostSoftwareDeviceMocks.ps1 │ │ │ │ ├── VMHostVDSwitchMigrationMocks.ps1 │ │ │ │ ├── VMHostVMKernelActiveDumpFileMocks.ps1 │ │ │ │ ├── VMHostVMKernelActiveDumpPartitionMocks.ps1 │ │ │ │ ├── VMHostVMKernelDumpFileMocks.ps1 │ │ │ │ ├── VMHostVMKernelModuleMocks.ps1 │ │ │ │ ├── VMHostVssMigrationMocks.ps1 │ │ │ │ ├── VMHostVssNicMocks.ps1 │ │ │ │ ├── VMHostVssPortGroupMocks.ps1 │ │ │ │ ├── VMHostVssPortGroupSecurityMocks.ps1 │ │ │ │ ├── VMHostVssPortGroupShapingMocks.ps1 │ │ │ │ ├── VMHostVssPortGroupTeamingMocks.ps1 │ │ │ │ ├── VMHostvSANNetworkConfigurationMocks.ps1 │ │ │ │ ├── VmfsDatastoreMocks.ps1 │ │ │ │ └── vCenterVMHostMocks.ps1 │ │ │ ├── TestUtils.ps1 │ │ │ └── VMware.VimAutomation.Core │ │ │ │ ├── PowerCLITypes.cs │ │ │ │ ├── VMware.VimAutomation.Core.psd1 │ │ │ │ └── VMware.VimAutomation.Core.psm1 │ │ ├── VDPortGroup.Unit.Tests.ps1 │ │ ├── VDSwitch.Unit.Tests.ps1 │ │ ├── VDSwitchVMHost.Unit.Tests.ps1 │ │ ├── VMHostAccount.Unit.Tests.ps1 │ │ ├── VMHostAdvancedSettings.Unit.Tests.ps1 │ │ ├── VMHostAgentVM.Unit.Tests.ps1 │ │ ├── VMHostAuthentication.Unit.Tests.ps1 │ │ ├── VMHostCache.Unit.Tests.ps1 │ │ ├── VMHostConfiguration.Unit.Tests.ps1 │ │ ├── VMHostDnsSettings.Unit.Tests.ps1 │ │ ├── VMHostFirewallRuleset.Unit.Tests.ps1 │ │ ├── VMHostGraphics │ │ │ ├── VMHostGraphics.Unit.Tests.ps1 │ │ │ └── VMHostGraphicsDevice.Unit.Tests.ps1 │ │ ├── VMHostIScsiHba │ │ │ ├── VMHostIScsiHba.Unit.Tests.ps1 │ │ │ ├── VMHostIScsiHbaBaseDSC.Unit.Tests.ps1 │ │ │ └── VMHostIScsiHbaTarget.Unit.Tests.ps1 │ │ ├── VMHostIScsiHbaVMKernelNic │ │ │ ├── VMHostIScsiHbaVMKernelNic.Mocks.Data.ps1 │ │ │ ├── VMHostIScsiHbaVMKernelNic.Mocks.ps1 │ │ │ └── VMHostIScsiHbaVMKernelNic.Unit.Tests.ps1 │ │ ├── VMHostNetwork │ │ │ ├── VMHostIPRoute │ │ │ │ └── VMHostIPRoute.Unit.Tests.ps1 │ │ │ ├── VMHostNetworkMigration │ │ │ │ ├── VMHostVDSwitchMigration.Unit.Tests.ps1 │ │ │ │ └── VMHostVssMigration.Unit.Tests.ps1 │ │ │ ├── VMHostNic │ │ │ │ ├── VMHostNicBaseDSC.Unit.Tests.ps1 │ │ │ │ ├── VMHostPhysicalNic.Unit.Tests.ps1 │ │ │ │ ├── VMHostVdsNic │ │ │ │ │ ├── VMHostVdsNic.Mocks.Data.ps1 │ │ │ │ │ ├── VMHostVdsNic.Mocks.ps1 │ │ │ │ │ └── VMHostVdsNic.Unit.Tests.ps1 │ │ │ │ └── VMHostVssNic.Unit.Tests.ps1 │ │ │ └── VMHostVssPortGroup │ │ │ │ ├── VMHostVssPortGroup.Unit.Tests.ps1 │ │ │ │ ├── VMHostVssPortGroupSecurity.Unit.Tests.ps1 │ │ │ │ ├── VMHostVssPortGroupShaping.Unit.Tests.ps1 │ │ │ │ └── VMHostVssPortGroupTeaming.Unit.Tests.ps1 │ │ ├── VMHostNtpSettings.Unit.Tests.ps1 │ │ ├── VMHostPciPassthrough.Unit.Tests.ps1 │ │ ├── VMHostPermission.Unit.Tests.ps1 │ │ ├── VMHostPowerPolicy.Unit.Tests.ps1 │ │ ├── VMHostRole.Unit.Tests.ps1 │ │ ├── VMHostSatpClaimRule.Unit.Tests.ps1 │ │ ├── VMHostScsiLun.Unit.Tests.ps1 │ │ ├── VMHostScsiLunPath.Unit.Tests.ps1 │ │ ├── VMHostService.Unit.Tests.ps1 │ │ ├── VMHostSettings.Unit.Tests.ps1 │ │ ├── VMHostStorage │ │ │ ├── VMHostStorage.Mocks.Data.ps1 │ │ │ ├── VMHostStorage.Mocks.ps1 │ │ │ └── VMHostStorage.Unit.Tests.ps1 │ │ ├── VMHostSyslog.Unit.Tests.ps1 │ │ ├── VMHostTpsSettings.Unit.Tests.ps1 │ │ ├── VMHostVss │ │ │ ├── VMHostVss.Unit.Tests.ps1 │ │ │ ├── VMHostVssBridge.Unit.Tests.ps1 │ │ │ ├── VMHostVssSecurity.Unit.Tests.ps1 │ │ │ ├── VMHostVssShaping.Unit.Tests.ps1 │ │ │ └── VMHostVssTeaming.Unit.Tests.ps1 │ │ ├── vCenterSettings.Unit.Tests.ps1 │ │ ├── vCenterStatistics.Unit.Tests.ps1 │ │ └── vCenterVMHost.Unit.Tests.ps1 │ └── UnitTests.ps1 │ ├── VMware.vSphereDSC.CompositeResourcesHelper.ps1 │ ├── VMware.vSphereDSC.Helper.psm1 │ ├── VMware.vSphereDSC.Logging.psm1 │ ├── VMware.vSphereDSC.build.ps1 │ ├── VMware.vSphereDSC.psd1 │ └── VMware.vSphereDSC.psm1 ├── VMware.PSDesiredStateConfiguration.md └── VMware.vSphereDSC.md /.gitignore: -------------------------------------------------------------------------------- 1 | *.mof 2 | .vscode 3 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: generic 2 | 3 | branches: 4 | only: 5 | - master 6 | 7 | env: 8 | global: 9 | - PSDS_CODECOVERAGE_RESULTFILE='psdsTestsCoverage' 10 | 11 | jobs: 12 | include: 13 | - stage: VMware.PSDesiredStateConfigurationTests 14 | os: linux 15 | dist: bionic 16 | addons: 17 | apt: 18 | sources: 19 | - sourceline: "deb [arch=amd64] https://packages.microsoft.com/ubuntu/18.04/prod bionic main" 20 | key_url: "https://packages.microsoft.com/keys/microsoft.asc" 21 | packages: 22 | - powershell 23 | workspaces: 24 | create: 25 | name: coverageWorkspace 26 | paths: 27 | - psdsTestsCoverage 28 | script: 29 | - pwsh -File './Build/enableExperimentalFeature.ps1' 30 | - pwsh -File './Build/VMware.PSDSCUnitTestsRunner.ps1' 31 | - stage: Build 32 | os: linux 33 | dist: trusty 34 | addons: 35 | apt: 36 | sources: 37 | - sourceline: "deb [arch=amd64] https://packages.microsoft.com/ubuntu/14.04/prod trusty main" 38 | key_url: "https://packages.microsoft.com/keys/microsoft.asc" 39 | packages: 40 | - powershell 41 | workspaces: 42 | use: coverageWorkspace 43 | before_install: 44 | - chmod +x Build/travis-push.sh 45 | script: 46 | - pwsh -File './Build/build.ps1' 47 | after_success: 48 | - '[ "${TRAVIS_EVENT_TYPE}" = "push" ] && [ "${TRAVIS_BRANCH}" = "master" ] && Build/travis-push.sh' 49 | -------------------------------------------------------------------------------- /Build/enableExperimentalFeature.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | <# 18 | .NOTES 19 | The code for enabling the experimental feature is in a separate file 20 | because the powershell session must be restarted when it is enabled 21 | #> 22 | 23 | Write-Host ('-------PS VERSION IS:' + $PSVersionTable['psversion']) 24 | 25 | if ($PSVersionTable['PsEdition'] -eq 'Core') { 26 | # check if the Invoke-DscResource emperimental feature is enabled 27 | if (-not [ExperimentalFeature]::IsEnabled('PSDesiredStateConfiguration.InvokeDscResource')) { 28 | Enable-ExperimentalFeature PSDesiredStateConfiguration.InvokeDscResource 29 | Write-Host ('-------InvokeDscResource is enabled') 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Build/travis-push.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | setup_git() { 4 | git config --global user.email "travis@travis-ci.org" 5 | git config --global user.name "Travis CI" 6 | } 7 | 8 | commit_updated_module_files() { 9 | git checkout master 10 | 11 | # Stage the modified module files 12 | git add -f . 13 | 14 | # Create a new commit with a custom build message 15 | # with "[skip ci]" to avoid a build loop 16 | # and Travis build number for reference 17 | git commit -s -m "Travis update: (Build $TRAVIS_BUILD_NUMBER)" -m "[skip ci]" 18 | } 19 | 20 | upload_files() { 21 | # Remove existing "origin" 22 | git remote rm origin 23 | 24 | # Add new "origin" with the access token 25 | git remote add origin https://${GH_TOKEN}@github.com/vmware/dscr-for-vmware.git > /dev/null 2>&1 26 | git push origin master --quiet 27 | } 28 | 29 | setup_git 30 | 31 | commit_updated_module_files 32 | 33 | # Attempt to commit to git only if "git commit" succeeded 34 | if [ $? -eq 0 ]; then 35 | echo "A new commit with changed module files exists. Uploading to GitHub." 36 | upload_files 37 | else 38 | echo "No changes in module files. Nothing to do." 39 | fi 40 | -------------------------------------------------------------------------------- /CHANGELOG_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## Module Name Module Version - Date in the following format: yyyy-mm-dd 2 | ### Added 3 | - 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. 4 | 5 | ### Changed 6 | - 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. 7 | 8 | ### Removed 9 | - 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. 10 | -------------------------------------------------------------------------------- /COMMITTING_GUIDELINES.md: -------------------------------------------------------------------------------- 1 | # Committing Guidelines 2 | 3 | By **default** when committing to the repository you need to Sign-Off all your commits. 4 | 5 | You can use the following template via the command line when committing to the repository: 6 | 7 | ``` 8 | git add . 9 | git commit -s -m 10 | git push origin 11 | ``` 12 | 13 | The '-s' flag automatically adds the following line to the commit message: 14 | 15 | ``` 16 | Signed-off-by: 17 | ``` 18 | 19 | You can set your name and email with the following template: 20 | 21 | ``` 22 | git config --global user.name 23 | git config --global user.email 24 | ``` 25 | 26 | ## Keeping a fork up to date 27 | 28 | ### 1. Clone your fork: 29 | ``` 30 | git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git 31 | ``` 32 | 33 | ### 2. Add remote from original repository in your forked repository: 34 | ``` 35 | cd into/cloned/fork-repo 36 | git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git 37 | git fetch upstream 38 | ``` 39 | 40 | ### 3. Updating your fork from original repo to keep up with their changes: 41 | 42 | #### 3.1 Keep your master branch up to date: 43 | ``` 44 | git rebase upstream/master 45 | ``` 46 | 47 | #### 3.2 Keep your feature branch up to date: 48 | ``` 49 | git stash 50 | git checkout master 51 | git rebase upstream/master 52 | git checkout 53 | git rebase master 54 | ``` 55 | -------------------------------------------------------------------------------- /Documentation/DSCResources/PowerCLISettings/PowerCLISettings.md: -------------------------------------------------------------------------------- 1 | # PowerCLISettings 2 | 3 | ## Parameters 4 | 5 | | Parameter | Attribute | DataType | Description | Allowed Values | 6 | | --- | --- | --- | --- | --- | 7 | | **SettingsScope** | Key | PowerCLISettingsScope | Specifies the scope on which the PowerCLI Settings will be applied. |LCM| 8 | | **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| 9 | | **DefaultVIServerMode** | Optional | DefaultVIServerMode | Specifies the server connection mode. |Single, Multiple, Unset| 10 | | **DisplayDeprecationWarnings** | Optional | bool | Indicates whether you want to see warnings about deprecated elements. || 11 | | **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| 12 | | **ParticipateInCeip** | Optional | bool | Specifies if PowerCLI should send anonymous usage information to VMware. || 13 | | **ProxyPolicy** | Optional | ProxyPolicy | Specifies whether VMware PowerCLI uses a system proxy server to connect to the vCenter Server system. |NoProxy, UseSystemProxy, Unset| 14 | | **WebOperationTimeoutSeconds** | Optional | int | Defines the timeout for Web operations. The default value is 300 sec. || 15 | 16 | ## Description 17 | 18 | The 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. 19 | 20 | ## Examples 21 | 22 | ### Example 1 23 | 24 | Updates the ParticipateInCeip, InvalidCertificateAction, DefaultVIServerMode and DisplayDeprecationWarnings PowerCLI Configuration settings. 25 | 26 | ````powershell 27 | Configuration PowerCLISettings_Config { 28 | Import-DscResource -ModuleName VMware.vSphereDSC 29 | 30 | Node localhost { 31 | PowerCLISettings powerCLISettings { 32 | SettingsScope = 'LCM' 33 | ParticipateInCeip = $false 34 | InvalidCertificateAction = 'Warn' 35 | DefaultVIServerMode = 'Multiple' 36 | DisplayDeprecationWarnings = $false 37 | } 38 | } 39 | } 40 | ```` 41 | -------------------------------------------------------------------------------- /Documentation/DSCResources/VMHostAcceptanceLevel/VMHostAcceptanceLevel.md: -------------------------------------------------------------------------------- 1 | # VMHostAcceptanceLevel 2 | 3 | ## Parameters 4 | 5 | | Parameter | Attribute | DataType | Description | Allowed Values | 6 | | --- | --- | --- | --- | --- | 7 | | **Server** | Key | string | The name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. || 8 | | **Credential** | Mandatory | PSCredential | The credentials needed for connection to the specified Server. || 9 | | **Name** | Key | string | The name of the VMHost. || 10 | | **Level** | Mandatory | AcceptanceLevel | The acceptance level of the VMHost. | VMwareCertified, VMwareAccepted, PartnerSupported, CommunitySupported | 11 | 12 | ## Description 13 | 14 | The resource is used to modify the acceptance level of the specified VMHost. 15 | 16 | ## Examples 17 | 18 | ### Example 1 19 | 20 | Modifies the VMHost acceptance level by setting it to **CommunitySupported**. 21 | 22 | ```powershell 23 | Configuration VMHostAcceptanceLevel_ModifyVMHostAcceptanceLevel_Config { 24 | Param( 25 | [Parameter(Mandatory = $true)] 26 | [ValidateNotNullOrEmpty()] 27 | [string] 28 | $Server, 29 | 30 | [Parameter(Mandatory = $true)] 31 | [ValidateNotNullOrEmpty()] 32 | [System.Management.Automation.PSCredential] 33 | $Credential, 34 | 35 | [Parameter(Mandatory = $true)] 36 | [ValidateNotNullOrEmpty()] 37 | [string] 38 | $Name 39 | ) 40 | 41 | Import-DscResource -ModuleName VMware.vSphereDSC 42 | 43 | Node localhost { 44 | VMHostAcceptanceLevel VMHostAcceptanceLevel { 45 | Server = $Server 46 | Credential = $Credential 47 | Name = $Name 48 | Level = 'CommunitySupported' 49 | } 50 | } 51 | } 52 | ``` 53 | -------------------------------------------------------------------------------- /Documentation/DSCResources/VMHostCache/VMHostCache.md: -------------------------------------------------------------------------------- 1 | # VMHostCache 2 | 3 | ## Parameters 4 | 5 | | Parameter | Attribute | DataType | Description | Allowed Values | 6 | | --- | --- | --- | --- | --- | 7 | | **Server** | Key | string | Name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. || 8 | | **Name** | Key | string | Name of the VMHost to configure. || 9 | | **Credential** | Mandatory | PSCredential | Credentials needed for connection to the specified Server. || 10 | | **DatastoreName** | Key | string | The name of the Datastore used for swap performance enhancement. || 11 | | **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. || 12 | 13 | ## Description 14 | 15 | The resource is used to Configure the host cache/swap performance enhancement by setting the Space to allocate on the specified SSD based Datastore. 16 | 17 | ## Examples 18 | 19 | ### Example 1 20 | 21 | Performs an Update operation by setting the Space to allocate on the specified SSD based Datastore to **1 GB**. 22 | 23 | ```powershell 24 | Configuration VMHostCache_Config { 25 | Param( 26 | [Parameter(Mandatory = $true)] 27 | [ValidateNotNullOrEmpty()] 28 | [string] 29 | $Name, 30 | 31 | [Parameter(Mandatory = $true)] 32 | [ValidateNotNullOrEmpty()] 33 | [string] 34 | $Server, 35 | 36 | [Parameter(Mandatory = $true)] 37 | [ValidateNotNullOrEmpty()] 38 | [System.Management.Automation.PSCredential] 39 | $Credential 40 | ) 41 | 42 | Import-DscResource -ModuleName VMware.vSphereDSC 43 | 44 | Node localhost { 45 | VMHostCache VMHostCache { 46 | Name = $Name 47 | Server = $Server 48 | Credential = $Credential 49 | DatastoreName = 'MyDatastore' 50 | SwapSizeGB = 1 51 | } 52 | } 53 | } 54 | ``` 55 | -------------------------------------------------------------------------------- /Documentation/DSCResources/VMHostDCUIKeyboard/VMHostDCUIKeyboard.md: -------------------------------------------------------------------------------- 1 | # VMHostDCUIKeyboard 2 | 3 | ## Parameters 4 | 5 | | Parameter | Attribute | DataType | Description | Allowed Values | 6 | | --- | --- | --- | --- | --- | 7 | | **Server** | Key | string | The name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. || 8 | | **Credential** | Mandatory | PSCredential | The credentials needed for connection to the specified Server. || 9 | | **Name** | Key | string | The name of the VMHost. || 10 | | **Layout** | Mandatory | string | The name of the Direct Console User Interface Keyboard Layout. || 11 | 12 | ## Description 13 | 14 | The resource is used to modify the Direct Console User Interface Keyboard Layout. 15 | 16 | ## Examples 17 | 18 | ### Example 1 19 | 20 | Modifies the Direct Console User Interface Keyboard Layout to be **US Default**. 21 | 22 | ```powershell 23 | Configuration VMHostDCUIKeyboard_ModifyVMHostDCUIKeyboardLayout_Config { 24 | Param( 25 | [Parameter(Mandatory = $true)] 26 | [ValidateNotNullOrEmpty()] 27 | [string] 28 | $Server, 29 | 30 | [Parameter(Mandatory = $true)] 31 | [ValidateNotNullOrEmpty()] 32 | [System.Management.Automation.PSCredential] 33 | $Credential, 34 | 35 | [Parameter(Mandatory = $true)] 36 | [ValidateNotNullOrEmpty()] 37 | [string] 38 | $Name 39 | ) 40 | 41 | Import-DscResource -ModuleName VMware.vSphereDSC 42 | 43 | Node localhost { 44 | VMHostDCUIKeyboard VMHostDCUIKeyboard { 45 | Server = $Server 46 | Credential = $Credential 47 | Name = $Name 48 | Layout = 'US Default' 49 | } 50 | } 51 | } 52 | ``` 53 | -------------------------------------------------------------------------------- /Documentation/DSCResources/VMHostGraphics/VMHostGraphics.md: -------------------------------------------------------------------------------- 1 | # VMHostGraphics 2 | 3 | ## Parameters 4 | 5 | | Parameter | Attribute | DataType | Description | Allowed Values | 6 | | --- | --- | --- | --- | --- | 7 | | **Server** | Key | string | Name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. || 8 | | **Name** | Key | string | Name of the VMHost to configure. || 9 | | **Credential** | Mandatory | PSCredential | Credentials needed for connection to the specified Server. || 10 | | **GraphicsType** | Mandatory | GraphicsType | The default graphics type for the specified VMHost. | Shared, SharedDirect | 11 | | **SharedPassthruAssignmentPolicy** | Mandatory | SharedPassthruAssignmentPolicy | The policy for assigning shared passthrough VMs to a host graphics device. | Performance, Consolidation | 12 | | **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. || 13 | 14 | ## Prerequisite 15 | 16 | The specified VMHost must be in **Maintenance** mode. 17 | 18 | ## Description 19 | 20 | The 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. 21 | 22 | ## Examples 23 | 24 | ### Example 1 25 | 26 | Performs an Update operation by setting the DefaultGraphicsType to **Shared** and SharedPassthruAssignmentPolicy to **Performance**. After that it restarts the specified VMHost to apply the changes. 27 | 28 | ```powershell 29 | Configuration VMHostGraphics_Config { 30 | Param( 31 | [Parameter(Mandatory = $true)] 32 | [ValidateNotNullOrEmpty()] 33 | [string] 34 | $Name, 35 | 36 | [Parameter(Mandatory = $true)] 37 | [ValidateNotNullOrEmpty()] 38 | [string] 39 | $Server, 40 | 41 | [Parameter(Mandatory = $true)] 42 | [ValidateNotNullOrEmpty()] 43 | [System.Management.Automation.PSCredential] 44 | $Credential 45 | ) 46 | 47 | Import-DscResource -ModuleName VMware.vSphereDSC 48 | 49 | Node localhost { 50 | VMHostGraphics VMHostGraphics { 51 | Name = $Name 52 | Server = $Server 53 | Credential = $Credential 54 | GraphicsType = 'Shared' 55 | SharedPassthruAssignmentPolicy = 'Performance' 56 | RestartTimeoutMinutes = 10 57 | } 58 | } 59 | } 60 | ``` 61 | -------------------------------------------------------------------------------- /Documentation/DSCResources/VMHostGraphicsDevice/VMHostGraphicsDevice.md: -------------------------------------------------------------------------------- 1 | # VMHostGraphicsDevice 2 | 3 | ## Parameters 4 | 5 | | Parameter | Attribute | DataType | Description | Allowed Values | 6 | | --- | --- | --- | --- | --- | 7 | | **Server** | Key | string | Name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. || 8 | | **Name** | Key | string | Name of the VMHost to configure. || 9 | | **Credential** | Mandatory | PSCredential | Credentials needed for connection to the specified Server. || 10 | | **Id** | Key | string | The Graphics device identifier (ex. PCI ID). || 11 | | **GraphicsType** | Mandatory | GraphicsType | The graphics type for the specified Device in 'Id' property. | Shared, SharedDirect | 12 | | **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. || 13 | 14 | ## Prerequisite 15 | 16 | The specified VMHost must be in **Maintenance** mode. 17 | 18 | ## Description 19 | 20 | The resource is used to update the Graphics Type of the specified Graphics Device. The resource also restarts the VMHost after a successful Update operation. 21 | 22 | ## Examples 23 | 24 | ### Example 1 25 | 26 | Performs 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. 27 | 28 | ```powershell 29 | Configuration VMHostGraphicsDevice_Config { 30 | Param( 31 | [Parameter(Mandatory = $true)] 32 | [ValidateNotNullOrEmpty()] 33 | [string] 34 | $Name, 35 | 36 | [Parameter(Mandatory = $true)] 37 | [ValidateNotNullOrEmpty()] 38 | [string] 39 | $Server, 40 | 41 | [Parameter(Mandatory = $true)] 42 | [ValidateNotNullOrEmpty()] 43 | [System.Management.Automation.PSCredential] 44 | $Credential 45 | ) 46 | 47 | Import-DscResource -ModuleName VMware.vSphereDSC 48 | 49 | Node localhost { 50 | VMHostGraphicsDevice VMHostGraphicsDevice { 51 | Name = $Name 52 | Server = $Server 53 | Credential = $Credential 54 | Id = '0000:00:00.0' 55 | GraphicsType = 'SharedDirect' 56 | RestartTimeoutMinutes = 10 57 | } 58 | } 59 | } 60 | ``` 61 | -------------------------------------------------------------------------------- /Documentation/DSCResources/VMHostNetworkCoreDump/VMHostNetworkCoreDump.md: -------------------------------------------------------------------------------- 1 | # VMHostNetworkCoreDump 2 | 3 | ## Parameters 4 | 5 | | Parameter | Attribute | DataType | Description | Allowed Values | 6 | | --- | --- | --- | --- | --- | 7 | | **Server** | Key | string | The name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. || 8 | | **Credential** | Mandatory | PSCredential | The credentials needed for connection to the specified Server. || 9 | | **Name** | Key | string | The name of the VMHost. || 10 | | **Enable** | Optional | bool | Specifies whether to enable network coredump. || 11 | | **InterfaceName** | Optional | string | The active interface to be used for the network coredump. || 12 | | **ServerIp** | Optional | string | The IP address of the coredump server (IPv4 or IPv6). || 13 | | **ServerPort** | Optional | long | The port on which the coredump server is listening. || 14 | 15 | ## Description 16 | 17 | The resource is used to modify the network coredump configuration of the specified VMHost. 18 | 19 | ## Examples 20 | 21 | ### Example 1 22 | 23 | Modifies 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** 24 | and the port on which the coredump server is listening is **6500**. It also enables the network coredump. 25 | 26 | ```powershell 27 | Configuration VMHostNetworkCoreDump_ModifyVMHostNetworkCoreDumpConfiguration_Config { 28 | Param( 29 | [Parameter(Mandatory = $true)] 30 | [ValidateNotNullOrEmpty()] 31 | [string] 32 | $Server, 33 | 34 | [Parameter(Mandatory = $true)] 35 | [ValidateNotNullOrEmpty()] 36 | [System.Management.Automation.PSCredential] 37 | $Credential, 38 | 39 | [Parameter(Mandatory = $true)] 40 | [ValidateNotNullOrEmpty()] 41 | [string] 42 | $Name, 43 | 44 | [Parameter(Mandatory = $true)] 45 | [ValidateNotNullOrEmpty()] 46 | [string] 47 | $VMHostVMKernelNetworkAdapterName 48 | ) 49 | 50 | Import-DscResource -ModuleName VMware.vSphereDSC 51 | 52 | Node localhost { 53 | VMHostNetworkCoreDump VMHostNetworkCoreDump { 54 | Server = $Server 55 | Credential = $Credential 56 | Name = $Name 57 | Enable = $true 58 | InterfaceName = $VMHostVMKernelNetworkAdapterName 59 | ServerIp = '10.11.12.13' 60 | ServerPort = 6500 61 | } 62 | } 63 | } 64 | ``` 65 | -------------------------------------------------------------------------------- /Documentation/DSCResources/VMHostNtpSettings/VMHostNtpSettings.md: -------------------------------------------------------------------------------- 1 | # VMHostNtpSettings 2 | 3 | ## Parameters 4 | 5 | | Parameter | Attribute | DataType | Description | Allowed Values | 6 | | --- | --- | --- | --- | --- | 7 | | **Server** | Key | string | Name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. || 8 | | **Name** | Key | string | Name of the VMHost to configure. || 9 | | **Credential** | Mandatory | PSCredential | Credentials needed for connection to the specified Server. || 10 | | **NtpServer** | Optional | string[] | List of domain name or IP address of the desired NTP Servers. || 11 | | **NtpServicePolicy** | Optional | ServicePolicy | Desired Policy of the VMHost 'ntpd' service activation. |Unset, On, Off, Automatic| 12 | 13 | ## Description 14 | 15 | The resource is used to configure NTP Server property and the Service Policy of the 'ntpd' Service of a ESXi host. 16 | 17 | ## Examples 18 | 19 | ### Example 1 20 | 21 | Updates the NTP Server array with the desired values and changes the 'ntpd' Service Policy to 'automatic' of the passed ESXi host. 22 | 23 | ````powershell 24 | param( 25 | [Parameter(Mandatory = $true)] 26 | [string] 27 | $Name, 28 | 29 | [Parameter(Mandatory = $true)] 30 | [string] 31 | $Server, 32 | 33 | [Parameter(Mandatory = $true)] 34 | [string] 35 | $User, 36 | 37 | [Parameter(Mandatory = $true)] 38 | [string] 39 | $Password 40 | ) 41 | 42 | $script:configurationData = @{ 43 | AllNodes = @( 44 | @{ 45 | NodeName = 'localhost' 46 | PSDscAllowPlainTextPassword = $true 47 | } 48 | ) 49 | } 50 | 51 | Configuration VMHostNtpSettings_Config { 52 | Import-DscResource -ModuleName VMware.vSphereDSC 53 | 54 | Node localhost { 55 | $Password = $Password | ConvertTo-SecureString -AsPlainText -Force 56 | $Credential = New-Object System.Management.Automation.PSCredential($User, $Password) 57 | 58 | VMHostNtpSettings vmHostNtpSettings { 59 | Name = $Name 60 | Server = $Server 61 | Credential = $Credential 62 | NtpServer = @("0.bg.pool.ntp.org", "1.bg.pool.ntp.org", "2.bg.pool.ntp.org") 63 | NtpServicePolicy = "automatic" 64 | } 65 | } 66 | } 67 | ```` 68 | -------------------------------------------------------------------------------- /Documentation/DSCResources/VMHostPciPassthrough/VMHostPciPassthrough.md: -------------------------------------------------------------------------------- 1 | # VMHostPciPassthrough 2 | 3 | ## Parameters 4 | 5 | | Parameter | Attribute | DataType | Description | Allowed Values | 6 | | --- | --- | --- | --- | --- | 7 | | **Server** | Key | string | Name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. || 8 | | **Name** | Key | string | Name of the VMHost to configure. || 9 | | **Credential** | Mandatory | PSCredential | Credentials needed for connection to the specified Server. || 10 | | **Id** | Key | string | The Id of the PCI Device, composed of "bus:slot.function". || 11 | | **Enabled** | Mandatory | bool | Value indicating whether passThru has been configured for this device. || 12 | | **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. || 13 | 14 | ## Prerequisite 15 | 16 | The specified VMHost must be in **Maintenance** mode. 17 | 18 | ## Description 19 | 20 | The 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. 21 | 22 | ## Examples 23 | 24 | ### Example 1 25 | 26 | Performs an Update operation by enabling Passthrough on the specified PCI Device. After that it restarts the specified VMHost to apply the changes. 27 | 28 | ```powershell 29 | Configuration VMHostPciPassthrough_Config { 30 | Param( 31 | [Parameter(Mandatory = $true)] 32 | [ValidateNotNullOrEmpty()] 33 | [string] 34 | $Name, 35 | 36 | [Parameter(Mandatory = $true)] 37 | [ValidateNotNullOrEmpty()] 38 | [string] 39 | $Server, 40 | 41 | [Parameter(Mandatory = $true)] 42 | [ValidateNotNullOrEmpty()] 43 | [System.Management.Automation.PSCredential] 44 | $Credential 45 | ) 46 | 47 | Import-DscResource -ModuleName VMware.vSphereDSC 48 | 49 | Node localhost { 50 | VMHostPciPassthrough VMHostPciPassthrough { 51 | Name = $Name 52 | Server = $Server 53 | Credential = $Credential 54 | Id = '0000:00:00.0' 55 | Enabled = $true 56 | RestartTimeoutMinutes = 10 57 | } 58 | } 59 | } 60 | ``` 61 | -------------------------------------------------------------------------------- /Documentation/DSCResources/VMHostPowerPolicy/VMHostPowerPolicy.md: -------------------------------------------------------------------------------- 1 | # VMHostPowerPolicy 2 | 3 | ## Parameters 4 | 5 | | Parameter | Attribute | DataType | Description | Allowed Values | 6 | | --- | --- | --- | --- | --- | 7 | | **Server** | Key | string | Name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. || 8 | | **Name** | Key | string | Name of the VMHost to configure. || 9 | | **Credential** | Mandatory | PSCredential | Credentials needed for connection to the specified Server. || 10 | | **PowerPolicy** | Mandatory | PowerPolicy | The Power Management Policy for the specified VMHost. | HighPerformance, Balanced, LowPower, Custom | 11 | 12 | ## Description 13 | 14 | The resource is used to update the Power Management Policy of the specified VMHost. 15 | 16 | ## Examples 17 | 18 | ### Example 1 19 | 20 | Performs an Update operation by setting the Power Management Policy of the specified VMHost to **Balanced**. 21 | 22 | ```powershell 23 | Configuration VMHostPowerPolicy_Config { 24 | Param( 25 | [Parameter(Mandatory = $true)] 26 | [ValidateNotNullOrEmpty()] 27 | [string] 28 | $Name, 29 | 30 | [Parameter(Mandatory = $true)] 31 | [ValidateNotNullOrEmpty()] 32 | [string] 33 | $Server, 34 | 35 | [Parameter(Mandatory = $true)] 36 | [ValidateNotNullOrEmpty()] 37 | [System.Management.Automation.PSCredential] 38 | $Credential 39 | ) 40 | 41 | Import-DscResource -ModuleName VMware.vSphereDSC 42 | 43 | Node localhost { 44 | VMHostPowerPolicy VMHostPowerPolicy { 45 | Name = $Name 46 | Server = $Server 47 | Credential = $Credential 48 | PowerPolicy = 'Balanced' 49 | } 50 | } 51 | } 52 | ``` 53 | -------------------------------------------------------------------------------- /Documentation/DSCResources/VMHostService/VMHostService.md: -------------------------------------------------------------------------------- 1 | # VMHostService 2 | 3 | ## Parameters 4 | 5 | | Parameter | Attribute | DataType | Description | Allowed Values | 6 | | --- | --- | --- | --- | --- | 7 | | **Server** | Key | string | Name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. || 8 | | **Name** | Key | string | Name of the VMHost to configure. || 9 | | **Credential** | Mandatory | PSCredential | Credentials needed for connection to the specified Server. || 10 | | **Key** | Key | string | The key value of the service. || 11 | | **Policy** | Optional | ServicePolicy | The state of the service after a VMHost reboot. |Unset, On, Off, Automatic| 12 | | **Running** | Optional | bool | The current state of the service. || 13 | 14 | ## Description 15 | 16 | The resource is used to configure the host services on an ESXi host. 17 | 18 | ## Examples 19 | 20 | ### Example 1 21 | 22 | Updates the Policy and Running state of the SSH service on the passed ESXi host. 23 | 24 | ````powershell 25 | param( 26 | [Parameter(Mandatory = $true)] 27 | [string] 28 | $Name, 29 | 30 | [Parameter(Mandatory = $true)] 31 | [string] 32 | $Server, 33 | 34 | [Parameter(Mandatory = $true)] 35 | [string] 36 | $User, 37 | 38 | [Parameter(Mandatory = $true)] 39 | [string] 40 | $Password 41 | ) 42 | 43 | $script:configurationData = @{ 44 | AllNodes = @( 45 | @{ 46 | NodeName = 'localhost' 47 | PSDscAllowPlainTextPassword = $true 48 | } 49 | ) 50 | } 51 | 52 | Configuration VMHostService_Config { 53 | Import-DscResource -ModuleName VMware.vSphereDSC 54 | 55 | Node localhost { 56 | $Password = $Password | ConvertTo-SecureString -AsPlainText -Force 57 | $Credential = New-Object System.Management.Automation.PSCredential($User, $Password) 58 | 59 | VMHostService vmHostService { 60 | Name = $Name 61 | Server = $Server 62 | Credential = $Credential 63 | Key = 'TSM-SSH' 64 | Policy = 'On' 65 | Running = $true 66 | } 67 | } 68 | } 69 | ```` 70 | -------------------------------------------------------------------------------- /Documentation/DSCResources/VMHostSettings/VMHostSettings.md: -------------------------------------------------------------------------------- 1 | # VMHostSettings 2 | 3 | ## Parameters 4 | 5 | | Parameter | Attribute | DataType | Description | Allowed Values | 6 | | --- | --- | --- | --- | --- | 7 | | **Server** | Key | string | Name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. || 8 | | **Name** | Key | string | Name of the VMHost to configure. || 9 | | **Credential** | Mandatory | PSCredential | Credentials needed for connection to the specified Server. || 10 | | **Motd** | Optional | string | Motd Advanced Setting value. || 11 | | **MotdClear** | Optional | bool | Indicates whether the Motd content should be cleared. || 12 | | **Issue** | Optional | string | Issue Advanced Setting value. || 13 | | **IssueClear** | Optional | bool | Indicates whether the Issue content should be cleared. || 14 | 15 | ## Description 16 | 17 | The resource is used to Update Motd Setting and Issue Setting of the passed ESXi host. 18 | 19 | ## Examples 20 | 21 | ### Example 1 22 | 23 | Updates the Motd Setting and Issue Setting of the passed ESXi host. 24 | 25 | ````powershell 26 | param( 27 | [Parameter(Mandatory = $true)] 28 | [string] 29 | $Name, 30 | 31 | [Parameter(Mandatory = $true)] 32 | [string] 33 | $Server, 34 | 35 | [Parameter(Mandatory = $true)] 36 | [string] 37 | $User, 38 | 39 | [Parameter(Mandatory = $true)] 40 | [string] 41 | $Password 42 | ) 43 | 44 | $script:configurationData = @{ 45 | AllNodes = @( 46 | @{ 47 | NodeName = 'localhost' 48 | PSDscAllowPlainTextPassword = $true 49 | } 50 | ) 51 | } 52 | 53 | Configuration VMHostSettings_Config { 54 | Import-DscResource -ModuleName VMware.vSphereDSC 55 | 56 | Node localhost { 57 | $Password = $Password | ConvertTo-SecureString -AsPlainText -Force 58 | $Credential = New-Object System.Management.Automation.PSCredential($User, $Password) 59 | 60 | VMHostSettings vmHostSettings { 61 | Name = $Name 62 | Server = $Server 63 | Credential = $Credential 64 | Motd = 'Hello World from motd!' 65 | Issue = 'Hello World from issue!' 66 | } 67 | } 68 | } 69 | ```` 70 | -------------------------------------------------------------------------------- /Documentation/DSCResources/VMHostStorage/VMHostStorage.md: -------------------------------------------------------------------------------- 1 | # VMHostStorage 2 | 3 | ## Parameters 4 | 5 | | Parameter | Attribute | DataType | Description | Allowed Values | 6 | | --- | --- | --- | --- | --- | 7 | | **Server** | Key | string | The name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. || 8 | | **Credential** | Mandatory | PSCredential | The credentials needed for connection to the specified Server. || 9 | | **Name** | Key | string | The name of the VMHost. || 10 | | **Enabled** | Mandatory | bool | Whether the software iSCSI is enabled on the VMHost storage. || 11 | 12 | ## Description 13 | 14 | The resource is used to enable or disable the software iSCSI support for the specified VMHost. 15 | 16 | ## Examples 17 | 18 | ### Example 1 19 | 20 | Enables the software iSCSI for the specified VMHost. 21 | 22 | ```powershell 23 | Configuration VMHostStorage_EnableSoftwareIscsi_Config { 24 | Param( 25 | [Parameter(Mandatory = $true)] 26 | [ValidateNotNullOrEmpty()] 27 | [string] 28 | $Server, 29 | 30 | [Parameter(Mandatory = $true)] 31 | [ValidateNotNullOrEmpty()] 32 | [System.Management.Automation.PSCredential] 33 | $Credential, 34 | 35 | [Parameter(Mandatory = $true)] 36 | [ValidateNotNullOrEmpty()] 37 | [string] 38 | $VMHostName 39 | ) 40 | 41 | Import-DscResource -ModuleName VMware.vSphereDSC 42 | 43 | Node localhost { 44 | VMHostStorage VMHostStorage { 45 | Server = $Server 46 | Credential = $Credential 47 | Name = $VMHostName 48 | Enabled = $true 49 | } 50 | } 51 | } 52 | ``` 53 | -------------------------------------------------------------------------------- /Documentation/DSCResources/VMHostTpsSettings/VMHostTpsSettings.md: -------------------------------------------------------------------------------- 1 | # VMHostTpsSettings 2 | 3 | ## Parameters 4 | 5 | | Parameter | Attribute | DataType | Description | Allowed Values | 6 | | --- | --- | --- | --- | --- | 7 | | **Server** | Key | string | Name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. || 8 | | **Name** | Key | string | Name of the VMHost to configure. || 9 | | **Credential** | Mandatory | PSCredential | Credentials needed for connection to the specified Server. || 10 | | **ShareScanTime** | Optional | int | Share Scan Time Advanced Setting value. || 11 | | **ShareScanGHz** | Optional | int | Share Scan GHz Advanced Setting value. || 12 | | **ShareRateMax** | Optional | int | Share Rate Max Advanced Setting value. || 13 | | **ShareForceSalting** | Optional | int | Share Force Salting Advanced Setting value. || 14 | 15 | ## Description 16 | 17 | The resource is used to configure TPS Settings of a ESXi host. 18 | 19 | ## Examples 20 | 21 | ### Example 1 22 | 23 | Updates the ShareScanTime and ShareForceSalting Advanced Settings values of the passed ESXi host. 24 | 25 | ````powershell 26 | param( 27 | [Parameter(Mandatory = $true)] 28 | [string] 29 | $Name, 30 | 31 | [Parameter(Mandatory = $true)] 32 | [string] 33 | $Server, 34 | 35 | [Parameter(Mandatory = $true)] 36 | [string] 37 | $User, 38 | 39 | [Parameter(Mandatory = $true)] 40 | [string] 41 | $Password 42 | ) 43 | 44 | $script:configurationData = @{ 45 | AllNodes = @( 46 | @{ 47 | NodeName = 'localhost' 48 | PSDscAllowPlainTextPassword = $true 49 | } 50 | ) 51 | } 52 | 53 | Configuration VMHostTpsSettings_Config { 54 | Import-DscResource -ModuleName VMware.vSphereDSC 55 | 56 | Node localhost { 57 | $Password = $Password | ConvertTo-SecureString -AsPlainText -Force 58 | $Credential = New-Object System.Management.Automation.PSCredential($User, $Password) 59 | 60 | VMHostTpsSettings vmHostTpsSettings { 61 | Name = $Name 62 | Server = $Server 63 | Credential = $Credential 64 | ShareScanTime = 50 65 | ShareForceSalting = 1 66 | } 67 | } 68 | } 69 | ```` 70 | -------------------------------------------------------------------------------- /Documentation/DSCResources/VMHostVMKernelActiveDumpFile/VMHostVMKernelActiveDumpFile.md: -------------------------------------------------------------------------------- 1 | # VMHostVMKernelActiveDumpFile 2 | 3 | ## Parameters 4 | 5 | | Parameter | Attribute | DataType | Description | Allowed Values | 6 | | --- | --- | --- | --- | --- | 7 | | **Server** | Key | string | The name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. || 8 | | **Credential** | Mandatory | PSCredential | The credentials needed for connection to the specified Server. || 9 | | **Name** | Key | string | The name of the VMHost. || 10 | | **Enable** | Optional | bool | Specifies whether the VMKernel dump file should be enabled or disabled. || 11 | | **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. || 12 | 13 | ## Description 14 | 15 | The resource is used to enable and disable the VMKernel dump file on the specified VMHost. 16 | 17 | ## Examples 18 | 19 | ### Example 1 20 | 21 | Enables the VMKernel dump file on the specified VMHost by selecting the best available file using the smart selection algorithm. 22 | 23 | ```powershell 24 | Configuration VMHostVMKernelActiveDumpFile_EnableVMKernelDumpFile_Config { 25 | Param( 26 | [Parameter(Mandatory = $true)] 27 | [ValidateNotNullOrEmpty()] 28 | [string] 29 | $Server, 30 | 31 | [Parameter(Mandatory = $true)] 32 | [ValidateNotNullOrEmpty()] 33 | [System.Management.Automation.PSCredential] 34 | $Credential, 35 | 36 | [Parameter(Mandatory = $true)] 37 | [ValidateNotNullOrEmpty()] 38 | [string] 39 | $Name 40 | ) 41 | 42 | Import-DscResource -ModuleName VMware.vSphereDSC 43 | 44 | Node localhost { 45 | VMHostVMKernelActiveDumpFile VMHostVMKernelActiveDumpFile { 46 | Server = $Server 47 | Credential = $Credential 48 | Name = $Name 49 | Enable = $true 50 | Smart = $true 51 | } 52 | } 53 | } 54 | ``` 55 | -------------------------------------------------------------------------------- /Documentation/DSCResources/VMHostVMKernelActiveDumpPartition/VMHostVMKernelActiveDumpPartition.md: -------------------------------------------------------------------------------- 1 | # VMHostVMKernelActiveDumpPartition 2 | 3 | ## Parameters 4 | 5 | | Parameter | Attribute | DataType | Description | Allowed Values | 6 | | --- | --- | --- | --- | --- | 7 | | **Server** | Key | string | The name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. || 8 | | **Credential** | Mandatory | PSCredential | The credentials needed for connection to the specified Server. || 9 | | **Name** | Key | string | The name of the VMHost. || 10 | | **Enable** | Optional | bool | Specifies whether the VMKernel dump partition should be enabled or disabled. || 11 | | **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. || 12 | 13 | ## Description 14 | 15 | The resource is used to enable and disable the VMKernel dump partition on the specified VMHost. 16 | 17 | ## Examples 18 | 19 | ### Example 1 20 | 21 | Enables the VMKernel dump partition on the specified VMHost by selecting the best available partition using the smart selection algorithm. 22 | 23 | ```powershell 24 | Configuration VMHostVMKernelActiveDumpPartition_EnableVMKernelDumpPartition_Config { 25 | Param( 26 | [Parameter(Mandatory = $true)] 27 | [ValidateNotNullOrEmpty()] 28 | [string] 29 | $Server, 30 | 31 | [Parameter(Mandatory = $true)] 32 | [ValidateNotNullOrEmpty()] 33 | [System.Management.Automation.PSCredential] 34 | $Credential, 35 | 36 | [Parameter(Mandatory = $true)] 37 | [ValidateNotNullOrEmpty()] 38 | [string] 39 | $Name 40 | ) 41 | 42 | Import-DscResource -ModuleName VMware.vSphereDSC 43 | 44 | Node localhost { 45 | VMHostVMKernelActiveDumpPartition VMHostVMKernelActiveDumpPartition { 46 | Server = $Server 47 | Credential = $Credential 48 | Name = $Name 49 | Enable = $true 50 | Smart = $true 51 | } 52 | } 53 | } 54 | ``` 55 | -------------------------------------------------------------------------------- /Documentation/DSCResources/VMHostVMKernelModule/VMHostVMKernelModule.md: -------------------------------------------------------------------------------- 1 | # VMHostVMKernelModule 2 | 3 | ## Parameters 4 | 5 | | Parameter | Attribute | DataType | Description | Allowed Values | 6 | | --- | --- | --- | --- | --- | 7 | | **Server** | Key | string | The name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. || 8 | | **Credential** | Mandatory | PSCredential | The credentials needed for connection to the specified Server. || 9 | | **Name** | Key | string | The name of the VMHost. || 10 | | **Module** | Key | string | The name of the VMKernel module. || 11 | | **Enabled** | Mandatory | bool | Specifies whether the module should be enabled or disabled. || 12 | | **Force** | Optional | bool | Specifies whether to skip the VMkernel module validity checks. || 13 | 14 | ## Description 15 | 16 | The resource is used to enable and disable the specified VMKernel module on the specified VMHost. 17 | 18 | ## Examples 19 | 20 | ### Example 1 21 | 22 | Enables the specified VMKernel module on the specified VMHost and skips the module validity checks. 23 | 24 | ```powershell 25 | Configuration VMHostVMKernelModule_EnableVMKernelModule_Config { 26 | Param( 27 | [Parameter(Mandatory = $true)] 28 | [ValidateNotNullOrEmpty()] 29 | [string] 30 | $Server, 31 | 32 | [Parameter(Mandatory = $true)] 33 | [ValidateNotNullOrEmpty()] 34 | [System.Management.Automation.PSCredential] 35 | $Credential, 36 | 37 | [Parameter(Mandatory = $true)] 38 | [ValidateNotNullOrEmpty()] 39 | [string] 40 | $Name, 41 | 42 | [Parameter(Mandatory = $true)] 43 | [ValidateNotNullOrEmpty()] 44 | [string] 45 | $VMKernelModule 46 | ) 47 | 48 | Import-DscResource -ModuleName VMware.vSphereDSC 49 | 50 | Node localhost { 51 | VMHostVMKernelModule VMHostVMKernelModule { 52 | Server = $Server 53 | Credential = $Credential 54 | Name = $Name 55 | Module = $VMKernelModule 56 | Enabled = $true 57 | Force = $true 58 | } 59 | } 60 | } 61 | ``` 62 | -------------------------------------------------------------------------------- /Documentation/DSCResources/VMHostVssSecurity/VMHostVssSecurity.md: -------------------------------------------------------------------------------- 1 | # VMHostVssSecurity 2 | 3 | ## Parameters 4 | 5 | | Parameter | Attribute | DataType | Description | Allowed Values | 6 | | --- | --- | --- | --- | --- | 7 | | **Server** | Key | string | Name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. || 8 | | **Name** | Key | string | Name of the VMHost to configure. || 9 | | **Credential** | Mandatory | PSCredential | Credentials needed for connection to the specified Server. || 10 | | **Ensure** | Mandatory | Ensure | Value indicating if the VSS should be Present or Absent. | Present, Absent | 11 | | **VssName** | Key | string | The name of the VSS. || 12 | | **AllowPromiscuous** | Optional | boolean | The flag to indicate whether or not all traffic is seen on the port. || 13 | | **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. || 14 | | **MacChanges** | Optional | boolean | The flag to indicate whether or not the Media Access Control (MAC) address can be changed. || 15 | 16 | ## Description 17 | 18 | The resource is used to configure the security policy governing ports of a Virtual Switch. 19 | 20 | ## Examples 21 | 22 | ### Example 1 23 | 24 | Configures the security settings of the specified Virtual Switch. 25 | 26 | ````powershell 27 | param( 28 | [Parameter(Mandatory = $true)] 29 | [string] 30 | $Name, 31 | 32 | [Parameter(Mandatory = $true)] 33 | [string] 34 | $Server, 35 | 36 | [Parameter(Mandatory = $true)] 37 | [string] 38 | $User, 39 | 40 | [Parameter(Mandatory = $true)] 41 | [string] 42 | $Password 43 | ) 44 | 45 | $script:configurationData = @{ 46 | AllNodes = @( 47 | @{ 48 | NodeName = 'localhost' 49 | PSDscAllowPlainTextPassword = $true 50 | } 51 | ) 52 | } 53 | 54 | Configuration VMHostVssSecurity_Config { 55 | Import-DscResource -ModuleName VMware.vSphereDSC 56 | 57 | Node localhost { 58 | $Password = $Password | ConvertTo-SecureString -AsPlainText -Force 59 | $Credential = New-Object System.Management.Automation.PSCredential($User, $Password) 60 | 61 | VMHostVssSecurity vmHostVSSSecurity { 62 | Name = $Name 63 | Server = $Server 64 | Credential = $Credential 65 | VssName = 'VSS1' 66 | AllowPromiscuous = $true 67 | ForgedTransmits = $true 68 | MacChanges = $true 69 | } 70 | } 71 | } 72 | ```` 73 | -------------------------------------------------------------------------------- /Documentation/DSCResources/vCenterStatistics/vCenterStatistics.md: -------------------------------------------------------------------------------- 1 | # vCenterStatistics 2 | 3 | ## Parameters 4 | 5 | | Parameter | Attribute | DataType | Description | Allowed Values | 6 | | --- | --- | --- | --- | --- | 7 | | **Server** | Key | string | Name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. || 8 | | **Credential** | Mandatory | PSCredential | Credentials needed for connection to the specified Server. || 9 | | **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| 10 | | **PeriodLength** | Optional | long | Period for which the statistics are saved. || 11 | | **Level** | Optional | int | Specified Level value for the vCenter Statistics. || 12 | | **Enabled** | Optional | bool | If collecting statistics for the specified period unit is enabled. || 13 | | **IntervalMinutes** | Optional | long | Interval in Minutes, indicating the period for collecting statistics. || 14 | 15 | ## Description 16 | 17 | The resource is used to configure the Statistics Settings of a vCenter. 18 | 19 | ## Examples 20 | 21 | ### Example 1 22 | 23 | Updates the Statistics settings of the passed vCenter by changing the level to 2 for the Day period. 24 | 25 | ````powershell 26 | param( 27 | [Parameter(Mandatory = $true)] 28 | [string] 29 | $Server, 30 | 31 | [Parameter(Mandatory = $true)] 32 | [string] 33 | $User, 34 | 35 | [Parameter(Mandatory = $true)] 36 | [string] 37 | $Password 38 | ) 39 | 40 | $script:configurationData = @{ 41 | AllNodes = @( 42 | @{ 43 | NodeName = 'localhost' 44 | PSDscAllowPlainTextPassword = $true 45 | } 46 | ) 47 | } 48 | 49 | Configuration vCenterStatistics_Config { 50 | Import-DscResource -ModuleName VMware.vSphereDSC 51 | 52 | Node localhost { 53 | $Password = $Password | ConvertTo-SecureString -AsPlainText -Force 54 | $Credential = New-Object System.Management.Automation.PSCredential($User, $Password) 55 | 56 | vCenterStatistics vCenterStatistics { 57 | Server = $Server 58 | Credential = $Credential 59 | Period = "Day" 60 | Level = 2 61 | } 62 | } 63 | } 64 | ```` 65 | -------------------------------------------------------------------------------- /FORMATTING_GUIDELINES.md: -------------------------------------------------------------------------------- 1 | # Formatting Guidelines 2 | 3 | You can use the following settings when implementing your resources (The example is with [VS Code](https://code.visualstudio.com/)): 4 | 5 | ``` 6 | { 7 | "powershell.codeFormatting.openBraceOnSameLine": true, 8 | "powershell.codeFormatting.whitespaceBeforeOpenParen": true, 9 | "powershell.codeFormatting.whitespaceAroundOperator": true, 10 | "powershell.codeFormatting.whitespaceAfterSeparator": true, 11 | "powershell.codeFormatting.newLineAfterCloseBrace": true, 12 | "editor.tabSize": 4, 13 | "editor.insertSpaces": true, 14 | "editor.detectIndentation": false, 15 | "files.trimTrailingWhitespace": true 16 | } 17 | ``` 18 | 19 | VS Code formatting file is available in the .vscode folder (settings.json File). 20 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Desired State Configuration Resources for VMware 2 | 3 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 4 | 5 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 6 | 7 | BSD-2 License 8 | 9 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 10 | 11 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 12 | 13 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 16 | -------------------------------------------------------------------------------- /LIMITATIONS.md: -------------------------------------------------------------------------------- 1 | # List of known limitations 2 | This is is a list of known problems and limitations regarding Microsoft PowerShell Desired State Configuration and PowerShell. 3 | 4 | ## PowerShell 7.0 limitations 5 | - 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) 6 | - 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. 7 | - 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. 8 | - 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 9 | ``` 10 | Get-DscResources -Module '$modulename' 11 | ``` 12 | - **Invoke-DscResource** is currently having performance issues and will potentially get fixed in PowerShell 7.2 13 | Issue link: [PowerShell repo](https://github.com/PowerShell/PowerShell/issues/13996) 14 | -------------------------------------------------------------------------------- /NOTICE.txt: -------------------------------------------------------------------------------- 1 | Desired State Configuration Resources for VMware 2 | 3 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 4 | 5 | This 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. 6 | 7 | This 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. 8 | -------------------------------------------------------------------------------- /Source/VMware.PSDesiredStateConfiguration/Classes/Public/BaseDscMethodResult.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | <# 18 | .DESCRIPTION 19 | 20 | Base type for Invoke-VmwDscConfigurations results. 21 | #> 22 | class BaseDscMethodResult { 23 | [string] $NodeName 24 | 25 | BaseDscMethodResult([string] $nodeName) { 26 | $this.NodeName = $nodeName 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Source/VMware.PSDesiredStateConfiguration/Classes/Public/CompositeResourceGetMethodResult.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | <# 18 | .DESCRIPTION 19 | 20 | Used for get method result to represent composite DSC Resources. 21 | #> 22 | class CompositeResourceGetMethodResult { 23 | [string] $Name 24 | 25 | [PsObject[]] $InnerResources 26 | 27 | CompositeResourceGetMethodResult([string] $name, [PsObject[]] $innerResources) { 28 | $this.Name = $name 29 | $this.InnerResources = $innerResources 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Source/VMware.PSDesiredStateConfiguration/Classes/Public/DscConfigurationBlock.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | class DscConfigurationBlock { 18 | [string] $Name 19 | 20 | [System.Collections.Hashtable] $ConfigurationData 21 | 22 | [DscConfigurationBlockExtent] $Extent 23 | } 24 | -------------------------------------------------------------------------------- /Source/VMware.PSDesiredStateConfiguration/Classes/Public/DscConfigurationBlockExtent.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | class DscConfigurationBlockExtent { 18 | [string] $StartLine 19 | 20 | [string] $Text 21 | 22 | [string] $EndLine 23 | } 24 | -------------------------------------------------------------------------------- /Source/VMware.PSDesiredStateConfiguration/Classes/Public/DscGetMethodResult.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | <# 18 | .DESCRIPTION 19 | 20 | Result type for Get-VmwDscConfiguration. 21 | #> 22 | class DscGetMethodResult : BaseDscMethodResult { 23 | [PsObject[]] $ResourcesStates 24 | 25 | DscGetMethodResult([VmwDscNode] $node, [PsObject[]] $resources) : base($node.InstanceName) { 26 | $this.FillResourceStates($node, $resources) 27 | } 28 | 29 | hidden [void] FillResourceStates([VmwDscNode] $node, [PsObject[]] $resources) { 30 | $result = New-Object 'System.Collections.ArrayList' 31 | 32 | for ($i = 0; $i -lt $resources.Count; $i++) { 33 | $states = $resources[$i] 34 | $objectToAdd = $null 35 | 36 | if ($states.Count -gt 1) { 37 | $objectToAdd = [CompositeResourceGetMethodResult]::new($node.Resources[$i].InstanceName, $states) 38 | } else { 39 | $objectToAdd = $states 40 | } 41 | 42 | $result.Add($objectToAdd) | Out-Null 43 | } 44 | 45 | $this.ResourcesStates = $result.ToArray() 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Source/VMware.PSDesiredStateConfiguration/Classes/Public/DscItem.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | <# 18 | .DESCRIPTION 19 | 20 | Base class for a DSC Item. 21 | #> 22 | class DscItem { 23 | [ValidateNotNullOrEmpty()] 24 | [string] $InstanceName 25 | 26 | DscItem($instanceName) { 27 | $this.InstanceName = $instanceName 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Source/VMware.PSDesiredStateConfiguration/Classes/Public/VmwDscConfiguration.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | <# 18 | .DESCRIPTION 19 | 20 | Class that defines a DSC Configuration. 21 | #> 22 | class VmwDscConfiguration : DscItem { 23 | [VmwDscNode[]] $Nodes 24 | 25 | VmwDscConfiguration($instanceName, $nodes) : base($instanceName) { 26 | $this.Nodes = $nodes 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Source/VMware.PSDesiredStateConfiguration/Classes/Public/VmwDscNode.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | <# 18 | .DESCRIPTION 19 | 20 | Class that defines a regular DSC Node. 21 | #> 22 | class VmwDscNode : DscItem { 23 | [VmwDscResource[]] $Resources 24 | 25 | VmwDscNode($connection, $resources) : base($connection) { 26 | $this.Resources = $resources 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Source/VMware.PSDesiredStateConfiguration/Classes/Public/VmwVsphereDscNode.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | <# 18 | .DESCRIPTION 19 | 20 | Class that defines a vSphere DSC Node. 21 | #> 22 | class VmwVsphereDscNode : VmwDscNode { 23 | VmwVsphereDscNode($connection, $resources) : base($connection, $resources) { } 24 | } 25 | -------------------------------------------------------------------------------- /Source/VMware.PSDesiredStateConfiguration/Functions/Public/Start-VmwDscConfiguration.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | <# 18 | .DESCRIPTION 19 | 20 | Invokes the DSC Configuration with the 'Set' DSC method. 21 | Every Resource that is not in desired state gets it's set method run. 22 | #> 23 | function Start-VmwDscConfiguration { 24 | [CmdletBinding()] 25 | param ( 26 | [Parameter(Mandatory = $true, 27 | ValueFromPipeline = $true, 28 | Position = 0)] 29 | [ValidateNotNullOrEmpty()] 30 | [VmwDscConfiguration] 31 | $Configuration, 32 | 33 | [Parameter(Mandatory = $false, 34 | ValueFromPipeline = $false, 35 | Position = 1)] 36 | [ValidateNotNullOrEmpty()] 37 | [PSObject] 38 | $ConnectionFilter 39 | ) 40 | 41 | $invokeParams = @{ 42 | Configuration = $Configuration 43 | ConnectionFilter = $ConnectionFilter 44 | Method = 'Set' 45 | } 46 | 47 | Invoke-VmwDscConfiguration @invokeParams -Verbose:$VerbosePreference | Out-Null 48 | } 49 | -------------------------------------------------------------------------------- /Source/VMware.PSDesiredStateConfiguration/Tests/Integration/ServerConfig.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | <# 18 | Here Servers are listed that will be used in the integration tests 19 | #> 20 | @( 21 | <# 22 | Entries Must be in the following format: 23 | 24 | @{ 25 | Server = '' 26 | User = '' 27 | Password = '' 28 | } 29 | #> 30 | ) 31 | -------------------------------------------------------------------------------- /Source/VMware.PSDesiredStateConfiguration/Tests/Required Dsc Resources/MyDscResource/DSCResources/CompositeResourceTest/CompositeResourceTest.psd1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | @{ 18 | 19 | # Script module or binary module file associated with this manifest. 20 | RootModule = 'CompositeResourceTest.schema.psm1' 21 | 22 | # Version number of this module. 23 | ModuleVersion = '1.0.0.0' 24 | 25 | # ID used to uniquely identify this module 26 | GUID = 'afa6b042-c83c-4991-97cc-931cc81a3d06' 27 | 28 | # Author of this module 29 | Author = 'VMware' 30 | 31 | # Company or vendor of this module 32 | CompanyName = 'VMware' 33 | 34 | # Copyright statement for this module 35 | Copyright = '(c) VMware. All rights reserved.' 36 | 37 | # Description of the functionality provided by this module 38 | Description = 'Test DSC Composite Resource.' 39 | 40 | # Minimum version of the Windows PowerShell engine required by this module 41 | PowerShellVersion = '5.1' 42 | } 43 | -------------------------------------------------------------------------------- /Source/VMware.PSDesiredStateConfiguration/Tests/Required Dsc Resources/MyDscResource/DSCResources/CompositeResourceTest/CompositeResourceTest.schema.psm1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | Configuration CompositeResourceTest { 18 | Param( 19 | $Value 20 | ) 21 | 22 | Import-DscResource -ModuleName MyDscResource 23 | 24 | MyTestResource Test 25 | { 26 | SomeVal = $Value 27 | Ensure = 'Present' 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Source/VMware.PSDesiredStateConfiguration/Tests/Required Dsc Resources/MyDscResource/MyDscResource.psd1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | @{ 18 | 19 | # Script module or binary module file associated with this manifest. 20 | RootModule = 'MyDscResource.psm1' 21 | 22 | DscResourcesToExport = @( 23 | 'FileResource', 24 | 'MyTestResource' 25 | ) 26 | 27 | # Version number of this module. 28 | ModuleVersion = '1.0.0.0' 29 | 30 | # ID used to uniquely identify this module 31 | GUID = '81624038-5e71-40f8-8905-b1a87afe22d7' 32 | 33 | # Author of this module 34 | Author = 'VMware' 35 | 36 | # Company or vendor of this module 37 | CompanyName = 'VMware' 38 | 39 | # Copyright statement for this module 40 | Copyright = '(c) VMware. All rights reserved.' 41 | 42 | # Description of the functionality provided by this module 43 | Description = 'This module contains basic dsc resources designed for use in simple tests' 44 | 45 | # Minimum version of the Windows PowerShell engine required by this module 46 | PowerShellVersion = '5.1' 47 | } 48 | -------------------------------------------------------------------------------- /Source/VMware.PSDesiredStateConfiguration/Tests/Sample Configurations/ConfigurationData/AllNodes_ArrayWithNonHashtable_Value.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | $script:configurationData = @{ 18 | AllNodes = @( 19 | 'AllNodes' 20 | ) 21 | } 22 | 23 | Configuration Test 24 | { 25 | Import-DscResource -ModuleName MyDscResource 26 | 27 | FileResource file 28 | { 29 | Path = "path" 30 | SourcePath = "path" 31 | Ensure = "present" 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Source/VMware.PSDesiredStateConfiguration/Tests/Sample Configurations/ConfigurationData/AllNodes_HashtableValue_Without_NodeNameKey.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | $script:configurationData = @{ 18 | AllNodes = @( 19 | @{ 20 | NoNodeName = 'NoNodeName' 21 | } 22 | ) 23 | } 24 | 25 | Configuration Test 26 | { 27 | Import-DscResource -ModuleName MyDscResource 28 | 29 | FileResource file 30 | { 31 | Path = "path" 32 | SourcePath = "path" 33 | Ensure = "present" 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Source/VMware.PSDesiredStateConfiguration/Tests/Sample Configurations/ConfigurationData/AllNodes_NotAnArray.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | $script:configurationData = @{ 18 | AllNodes = 'AllNodes' 19 | } 20 | 21 | Configuration Test 22 | { 23 | Import-DscResource -ModuleName MyDscResource 24 | 25 | FileResource file 26 | { 27 | Path = "path" 28 | SourcePath = "path" 29 | Ensure = "present" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Source/VMware.PSDesiredStateConfiguration/Tests/Sample Configurations/ConfigurationData/AllNodes_Values_With_Duplicate_NodeNameKeys.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | $script:configurationData = @{ 18 | AllNodes = @( 19 | @{ 20 | NodeName = 'NodeName' 21 | }, 22 | @{ 23 | NodeName = 'NodeName' 24 | } 25 | ) 26 | } 27 | 28 | Configuration Test 29 | { 30 | Import-DscResource -ModuleName MyDscResource 31 | 32 | FileResource file 33 | { 34 | Path = "path" 35 | SourcePath = "path" 36 | Ensure = "present" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Source/VMware.PSDesiredStateConfiguration/Tests/Sample Configurations/Nodes/singleNode.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | <# 18 | Basic Configuration with only a single resource 19 | #> 20 | Configuration Test 21 | { 22 | Import-DscResource -ModuleName MyDscResource 23 | 24 | Node 'Sample Node' { 25 | FileResource file 26 | { 27 | Path = "path" 28 | SourcePath = "path" 29 | Ensure = "present" 30 | } 31 | } 32 | } 33 | 34 | $Script:expectedCompiled = [VmwDscConfiguration]::new( 35 | 'Test', 36 | @( 37 | [VmwDscNode]::new( 38 | 'Sample Node', 39 | @( 40 | [VmwDscResource]::new( 41 | 'file', 42 | 'FileResource', 43 | @{ ModuleName = 'MyDscResource'; RequiredVersion = '1.0' }, 44 | @{ 45 | Path = "path" 46 | SourcePath = "path" 47 | Ensure = "present" 48 | } 49 | ) 50 | ) 51 | ) 52 | ) 53 | ) 54 | -------------------------------------------------------------------------------- /Source/VMware.PSDesiredStateConfiguration/Tests/Sample Configurations/duplicateResources.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | <# 18 | .DESCRIPTION 19 | Configuration with duplicate resource names of the same type. 20 | Should throw exception. 21 | #> 22 | Configuration Test { 23 | Import-DscResource -ModuleName MyDscResource 24 | 25 | FileResource file 26 | { 27 | Path = "path" 28 | SourcePath = "path" 29 | Ensure = "present" 30 | } 31 | 32 | FileResource file 33 | { 34 | Path = "path2" 35 | SourcePath = "path2" 36 | Ensure = "absent" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Source/VMware.PSDesiredStateConfiguration/Tests/Sample Configurations/innerException.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | <# 18 | .DESCRIPTION 19 | Configuration that causes an exception during runtime. 20 | Should rethrow the exception. 21 | #> 22 | Configuration Test 23 | { 24 | Import-DscResource -ModuleName MyDscResource 25 | 26 | FileResource file 27 | { 28 | Path = "path" 29 | SourcePath = "path" 30 | Ensure = "present" 31 | } 32 | 33 | InvalidCall 34 | } 35 | -------------------------------------------------------------------------------- /Source/VMware.PSDesiredStateConfiguration/Tests/Sample Configurations/invalidDependsOn.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | <# 18 | .DESCRIPTION 19 | Configuration with a Resource that has an invalid dependsOn property. 20 | Should throw an exception. 21 | #> 22 | Configuration Test { 23 | Import-DscResource -ModuleName MyDscResource 24 | 25 | FileResource file 26 | { 27 | Path = 'path' 28 | SourcePath = 'path' 29 | Ensure = 'present' 30 | DependsOn = "Something else" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Source/VMware.PSDesiredStateConfiguration/Tests/Sample Configurations/simple.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | <# 18 | .DESCRIPTION 19 | Basic Configuration with only a single resource. 20 | Should compile the configuration correctly. 21 | #> 22 | Configuration Test 23 | { 24 | Import-DscResource -ModuleName MyDscResource 25 | 26 | FileResource file 27 | { 28 | Path = "path" 29 | SourcePath = "path" 30 | Ensure = "present" 31 | } 32 | } 33 | 34 | $Script:expectedCompiled = [VmwDscConfiguration]::new( 35 | 'Test', 36 | @( 37 | [VmwDscNode]::new( 38 | 'localhost', 39 | @( 40 | [VmwDscResource]::new( 41 | 'file', 42 | 'FileResource', 43 | @{ ModuleName = 'MyDscResource'; RequiredVersion = '1.0' }, 44 | @{ 45 | Path = "path" 46 | SourcePath = "path" 47 | Ensure = "present" 48 | } 49 | ) 50 | ) 51 | ) 52 | ) 53 | ) 54 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/Classes/BaseDSC.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | class BaseDSC : BasevSphereConnection { 18 | <# 19 | .DESCRIPTION 20 | 21 | Name of the Server we are trying to connect to. The Server can be a vCenter or ESXi. 22 | #> 23 | [DscProperty()] 24 | [string] $Server 25 | } 26 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/Classes/VMHostBaseDSC.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | class VMHostBaseDSC : BaseDSC { 18 | <# 19 | .DESCRIPTION 20 | 21 | Specifies the name of the VMHost to configure. 22 | #> 23 | [DscProperty(Key)] 24 | [string] $Name 25 | 26 | hidden [string] $CouldNotRetrieveVMHostMessage = "Could not retrieve VMHost {0} on Server {1}. For more information: {2}" 27 | 28 | <# 29 | .DESCRIPTION 30 | 31 | Retrieves the VMHost with the specified name from the specified Server. 32 | If the VMHost is not found, the method throws an exception. 33 | #> 34 | [PSObject] GetVMHost() { 35 | try { 36 | $getVMHostParams = @{ 37 | Server = $this.Connection 38 | Name = $this.Name 39 | ErrorAction = 'Stop' 40 | Verbose = $false 41 | } 42 | 43 | return Get-VMHost @getVMHostParams 44 | } 45 | catch { 46 | throw ($this.CouldNotRetrieveVMHostMessage -f $this.Name, $this.Connection.Name, $_.Exception.Message) 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/Classes/VMHostNetworkBaseDSC.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | class VMHostNetworkBaseDSC : VMHostBaseDSC { 18 | hidden [PSObject] $VMHostNetworkSystem 19 | 20 | hidden [string] $CouldNotRetrieveNetworkSystemMessage = "Could not retrieve the Network System of VMHost {0}. For more information: {1}" 21 | 22 | <# 23 | .DESCRIPTION 24 | 25 | Retrieves the Network System from the specified VMHost. 26 | #> 27 | [void] GetNetworkSystem($vmHost) { 28 | try { 29 | $this.VMHostNetworkSystem = Get-View -Server $this.Connection -Id $vmHost.ExtensionData.ConfigManager.NetworkSystem -ErrorAction Stop 30 | } 31 | catch { 32 | throw ($this.CouldNotRetrieveNetworkSystemMessage -f $this.Name, $_.Exception.Message) 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/Classes/VMHostVssBaseDSC.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | class VMHostVssBaseDSC : VMHostNetworkBaseDSC { 18 | <# 19 | .DESCRIPTION 20 | 21 | Value indicating if the VSS should be Present or Absent. 22 | #> 23 | [DscProperty(Mandatory)] 24 | [Ensure] $Ensure 25 | 26 | <# 27 | .DESCRIPTION 28 | 29 | The name of the VSS. 30 | #> 31 | [DscProperty(Key)] 32 | [string] $VssName 33 | 34 | <# 35 | .DESCRIPTION 36 | 37 | Returns the desired virtual switch if it is present on the server otherwise returns $null. 38 | #> 39 | [PSObject] GetVss() { 40 | $this.WriteLogUtil('Verbose', "{0} Entering {1}", @((Get-Date), (Get-PSCallStack)[0].FunctionName)) 41 | 42 | $this.vmHostNetworkSystem.UpdateViewData('NetworkInfo.Vswitch') 43 | return ($this.vmHostNetworkSystem.NetworkInfo.Vswitch | Where-Object { $_.Name -eq $this.VssName }) 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/Configurations/Ansible/README.md: -------------------------------------------------------------------------------- 1 | # Desired State Configuration Resources for VMware Examples with Ansible 2 | 3 | ## Getting Started 4 | ## Requirements 5 | 1. Install [Ansible](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html) 6 | 2. Setup [Windows Host](https://docs.ansible.com/ansible/latest/user_guide/windows_setup.html) 7 | 3. Put your Remote Systems following the instructions [here](https://docs.ansible.com/ansible/latest/user_guide/intro_getting_started.html) in the file: 8 | 9 | ```/etc/ansible/hosts``` 10 | 4. To apply your configuration run the following command in the Terminal: 11 | ``` 12 | ansible-playbook 13 | ``` 14 | 15 | ## Examples 16 | All shown examples are located [here](https://github.com/vmware/dscr-for-vmware/tree/master/Source/VMware.vSphereDSC/Configurations/Ansible). 17 | 18 | ### Example 1 19 | Updates 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. 20 | 21 | ```yaml 22 | - hosts: 23 | tasks: 24 | - name: Updates the Statistics settings of the passed vCenter. 25 | win_dsc: 26 | resource_name: vCenterStatistics 27 | Server: 28 | Credential_username: 29 | Credential_password: 30 | Period: Day 31 | PeriodLength: 3 32 | Level: 2 33 | Enabled: True 34 | IntervalMinutes: 3 35 | ``` 36 | 37 | For 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). 38 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/Configurations/Ansible/vCenter_Statistics_config.yml: -------------------------------------------------------------------------------- 1 | - hosts: 2 | tasks: 3 | - name: Updates the Statistics settings of the passed vCenter. 4 | win_dsc: 5 | resource_name: vCenterStatistics 6 | Server: 7 | Credential_username: 8 | Credential_password: 9 | Period: Day 10 | PeriodLength: 3 11 | Level: 2 12 | Enabled: True 13 | IntervalMinutes: 3 14 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/Configurations/Chef/cluster_config.rb: -------------------------------------------------------------------------------- 1 | dsc_script 'cluster' do 2 | imports 'VMware.vSphereDSC' 3 | configuration_data <<-EOH 4 | @{ 5 | AllNodes = @( 6 | @{ 7 | NodeName = "localhost"; 8 | PSDscAllowPlainTextPassword = $true 9 | }) 10 | } 11 | EOH 12 | code <<-EOH 13 | $Server = '' 14 | $User = '' 15 | $Password = ConvertTo-SecureString -String '' -AsPlainText -Force 16 | $Credential = New-Object System.Management.Automation.PSCredential($User, $Password) 17 | 18 | Cluster cluster 19 | { 20 | Server = $Server 21 | Credential = $Credential 22 | Ensure = 'Present' 23 | DatacenterInventoryPath = [string]::Empty 24 | Datacenter = 'Datacenter' 25 | Name = 'MyChefCluster' 26 | HAEnabled = $true 27 | HAAdmissionControlEnabled = $true 28 | HAFailoverLevel = 3 29 | HAIsolationResponse = 'DoNothing' 30 | HARestartPriority = 'Low' 31 | DrsEnabled = $true 32 | DrsAutomationLevel = 'FullyAutomated' 33 | DrsMigrationThreshold = 5 34 | DrsDistribution = 0 35 | MemoryLoadBalancing = 100 36 | CPUOverCommitment = 500 37 | } 38 | EOH 39 | end 40 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/Configurations/Chef/ha_cluster_config.rb: -------------------------------------------------------------------------------- 1 | dsc_resource 'ha-cluster' do 2 | resource :hacluster 3 | property :server, '' 4 | property :credential, ps_credential('', '') 5 | property :name, 'MyChefCluster' 6 | property :datacenterinventorypath, '' 7 | property :datacenter, 'Datacenter' 8 | property :ensure, 'Present' 9 | property :haenabled, true 10 | property :haadmissioncontrolenabled, true 11 | property :hafailoverlevel, 3 12 | property :haisolationresponse, 'DoNothing' 13 | property :harestartpriority, 'Low' 14 | end 15 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/Configurations/PowerShell/PowerCLISettingsConfigs/PowerCLISettings_Config.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | Configuration PowerCLISettings_Config { 18 | Import-DscResource -ModuleName VMware.vSphereDSC 19 | 20 | Node localhost { 21 | PowerCLISettings powerCLISettings { 22 | SettingsScope = 'LCM' # LCM is the only possible value for the Settings Scope. 23 | ParticipateInCeip = $false 24 | InvalidCertificateAction = 'Warn' 25 | DefaultVIServerMode = 'Multiple' 26 | DisplayDeprecationWarnings = $false 27 | } 28 | } 29 | } 30 | 31 | PowerCLISettings_Config 32 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/Configurations/Puppet/README.md: -------------------------------------------------------------------------------- 1 | # Desired State Configuration Resources for VMware Examples with Puppet 2 | 3 | ## Getting Started 4 | ## Requirements 5 | 1. Install [Puppet Agent](https://downloads.puppetlabs.com) 6 | 2. Install [DSC Lite Module](https://forge.puppet.com/puppetlabs/dsc_lite/readme) 7 | 3. To apply your configuration run the following command in Powershell: 8 | ```powershell 9 | puppet apply 10 | ``` 11 | 12 | ## Examples 13 | All shown examples are located [here](https://github.com/vmware/dscr-for-vmware/tree/master/Source/VMware.vSphereDSC/Configurations/Puppet). 14 | 15 | ### Example 1 16 | Updates the EventMaxAge Settings, TaskMaxAge Settings, Motd Setting, Issue Setting and the Logging Level of the passed vCenter. 17 | 18 | ``` 19 | dsc {'vCenter-Settings': 20 | resource_name => 'vCenterSettings', 21 | module => 'VMware.vSphereDSC', 22 | properties => { 23 | 'server' => '', 24 | 'credential' => { 25 | 'dsc_type' => 'MSFT_Credential', 26 | 'dsc_properties' => { 27 | 'user' => '', 28 | 'password' => Sensitive('') 29 | } 30 | }, 31 | 'logginglevel' => 'Warning', 32 | 'eventmaxageenabled' => false, 33 | 'eventmaxage' => 40, 34 | 'taskmaxageenabled' => false, 35 | 'taskmaxage' => 40, 36 | 'motd' => 'Hello World from motd!', 37 | 'issue' => 'Hello World from issue!' 38 | } 39 | } 40 | ``` 41 | 42 | For 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). 43 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/Configurations/Puppet/vcenter_settings_config.pp: -------------------------------------------------------------------------------- 1 | dsc {'vCenter-Settings': 2 | resource_name => 'vCenterSettings', 3 | module => 'VMware.vSphereDSC', 4 | properties => { 5 | 'server' => '', 6 | 'credential' => { 7 | 'dsc_type' => 'MSFT_Credential', 8 | 'dsc_properties' => { 9 | 'user' => '', 10 | 'password' => Sensitive('') 11 | } 12 | }, 13 | 'logginglevel' => 'Warning', 14 | 'eventmaxageenabled' => false, 15 | 'eventmaxage' => 40, 16 | 'taskmaxageenabled' => false, 17 | 'taskmaxage' => 40, 18 | 'motd' => 'Hello World from motd!', 19 | 'issue' => 'Hello World from issue!' 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/DSCResources/Cluster/Cluster.psd1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | @{ 18 | 19 | # Script module or binary module file associated with this manifest. 20 | RootModule = 'Cluster.schema.psm1' 21 | 22 | # Version number of this module. 23 | ModuleVersion = '1.0' 24 | 25 | # ID used to uniquely identify this module 26 | GUID = '3f15af41-f98a-4762-86b8-3272d28dffc0' 27 | 28 | # Author of this module 29 | Author = 'VMware' 30 | 31 | # Company or vendor of this module 32 | CompanyName = 'VMware' 33 | 34 | # Copyright statement for this module 35 | Copyright = '(c) 2018-2020 VMware. All rights reserved.' 36 | 37 | # Description of the functionality provided by this module 38 | Description = 'Cluster DSC Composite Resource.' 39 | 40 | # Minimum version of the Windows PowerShell engine required by this module 41 | PowerShellVersion = '5.1' 42 | 43 | } 44 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/DSCResources/StandardPortGroup/StandardPortGroup.psd1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | @{ 18 | 19 | # Script module or binary module file associated with this manifest. 20 | RootModule = 'StandardPortGroup.schema.psm1' 21 | 22 | # Version number of this module. 23 | ModuleVersion = '1.0' 24 | 25 | # ID used to uniquely identify this module 26 | GUID = 'ff5427e3-1a15-48af-92da-2941e051c9e7' 27 | 28 | # Author of this module 29 | Author = 'VMware' 30 | 31 | # Company or vendor of this module 32 | CompanyName = 'VMware' 33 | 34 | # Copyright statement for this module 35 | Copyright = '(c) 2018-2020 VMware. All rights reserved.' 36 | 37 | # Description of the functionality provided by this module 38 | Description = 'Standard Port Group DSC Composite Resource.' 39 | 40 | # Minimum version of the Windows PowerShell engine required by this module 41 | PowerShellVersion = '5.1' 42 | 43 | } 44 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/DSCResources/StandardSwitch/StandardSwitch.psd1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | @{ 18 | 19 | # Script module or binary module file associated with this manifest. 20 | RootModule = 'StandardSwitch.schema.psm1' 21 | 22 | # Version number of this module. 23 | ModuleVersion = '1.0' 24 | 25 | # ID used to uniquely identify this module 26 | GUID = '427e294f-9add-4e3e-a63d-28dad679a8cd' 27 | 28 | # Author of this module 29 | Author = 'VMware' 30 | 31 | # Company or vendor of this module 32 | CompanyName = 'VMware' 33 | 34 | # Copyright statement for this module 35 | Copyright = '(c) 2018-2020 VMware. All rights reserved.' 36 | 37 | # Description of the functionality provided by this module 38 | Description = 'Standard Switch DSC Composite Resource.' 39 | 40 | # Minimum version of the Windows PowerShell engine required by this module 41 | PowerShellVersion = '5.1' 42 | 43 | } 44 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/Enums/AcceptanceLevel.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | enum AcceptanceLevel { 18 | VMwareCertified 19 | VMwareAccepted 20 | PartnerSupported 21 | CommunitySupported 22 | } 23 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/Enums/ChapType.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | enum ChapType { 18 | Prohibited 19 | Discouraged 20 | Preferred 21 | Required 22 | Unset 23 | } 24 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/Enums/Cluster/DrsAutomationLevel.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | enum DrsAutomationLevel { 18 | FullyAutomated 19 | Manual 20 | PartiallyAutomated 21 | Disabled 22 | Unset 23 | } 24 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/Enums/Cluster/HAIsolationResponse.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | enum HAIsolationResponse { 18 | PowerOff 19 | DoNothing 20 | Shutdown 21 | Unset 22 | } 23 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/Enums/Cluster/HARestartPriority.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | enum HARestartPriority { 18 | Disabled 19 | Low 20 | Medium 21 | High 22 | Unset 23 | } 24 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/Enums/DRSRuleType.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | enum DRSRuleType { 18 | VMAffinity 19 | VMAntiAffinity 20 | } 21 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/Enums/Datastore/AccessMode.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | enum AccessMode { 18 | ReadWrite 19 | ReadOnly 20 | } 21 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/Enums/Datastore/AuthenticationMethod.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | enum AuthenticationMethod { 18 | AUTH_SYS 19 | Kerberos 20 | } 21 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/Enums/DomainAction.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | enum DomainAction { 18 | Join 19 | Leave 20 | } 21 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/Enums/Duplex.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | enum Duplex { 18 | Full 19 | Half 20 | Unset 21 | } 22 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/Enums/Ensure.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | enum Ensure { 18 | Absent 19 | Present 20 | } 21 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/Enums/EntityType.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | enum EntityType { 18 | Folder 19 | Datacenter 20 | Cluster 21 | Datastore 22 | DatastoreCluster 23 | VMHost 24 | ResourcePool 25 | VApp 26 | VM 27 | Template 28 | } 29 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/Enums/FolderType.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | enum FolderType { 18 | Network 19 | Datastore 20 | Vm 21 | Host 22 | } 23 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/Enums/GraphicsType.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | enum GraphicsType { 18 | Shared 19 | SharedDirect 20 | } 21 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/Enums/IScsiHbaTargetType.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | enum IScsiHbaTargetType { 18 | Static 19 | Send 20 | } 21 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/Enums/LinkDiscovertProtocolOperation.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | enum LinkDiscoveryProtocolOperation { 18 | Advertise 19 | Both 20 | Listen 21 | None 22 | Unset 23 | } 24 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/Enums/LinkDiscoveryProtocolProtocol.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | enum LinkDiscoveryProtocolProtocol { 18 | CDP 19 | LLDP 20 | Unset 21 | } 22 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/Enums/LoadBalancingPolicy.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | enum LoadBalancingPolicy { 18 | LoadBalanceIP 19 | LoadBalanceSrcMac 20 | LoadBalanceSrcId 21 | ExplicitFailover 22 | Unset 23 | } 24 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/Enums/LoggingLevel.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | enum LoggingLevel { 18 | Unset 19 | None 20 | Error 21 | Warning 22 | Info 23 | Verbose 24 | Trivia 25 | } 26 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/Enums/MultipathPolicy.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | enum MultipathPolicy { 18 | Fixed 19 | MostRecentlyUsed 20 | RoundRobin 21 | Unknown 22 | Unset 23 | } 24 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/Enums/NetworkFailoverDetectionPolicy.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | enum NetworkFailoverDetectionPolicy { 18 | LinkStatus 19 | BeaconProbing 20 | Unset 21 | } 22 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/Enums/Period.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | enum Period { 18 | Day = 86400 19 | Week = 604800 20 | Month = 2629800 21 | Year = 31556926 22 | } 23 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/Enums/PortBinding.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | enum PortBinding { 18 | Static 19 | Dynamic 20 | Ephemeral 21 | Unset 22 | } 23 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/Enums/PowerCLISettings/BadCertificateAction.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | enum BadCertificateAction { 18 | Ignore 19 | Warn 20 | Prompt 21 | Fail 22 | Unset 23 | } 24 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/Enums/PowerCLISettings/DefaultVIServerMode.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | enum DefaultVIServerMode { 18 | Single 19 | Multiple 20 | Unset 21 | } 22 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/Enums/PowerCLISettings/PowerCLISettingsScope.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | enum PowerCLISettingsScope { 18 | LCM 19 | } 20 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/Enums/PowerCLISettings/ProxyPolicy.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | enum ProxyPolicy { 18 | NoProxy 19 | UseSystemProxy 20 | Unset 21 | } 22 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/Enums/PowerPolicy.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | enum PowerPolicy { 18 | HighPerformance = 1 19 | Balanced = 2 20 | LowPower = 3 21 | Custom = 4 22 | } 23 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/Enums/ServicePolicy.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | enum ServicePolicy { 18 | Unset 19 | On 20 | Off 21 | Automatic 22 | } 23 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/Enums/SharedPassthruAssignmentPolicy.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | enum SharedPassthruAssignmentPolicy { 18 | Performance 19 | Consolidation 20 | } 21 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/Enums/VMHostState.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | enum VMHostState { 18 | Connected 19 | Disconnected 20 | Maintenance 21 | Unset 22 | } 23 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/Enums/VMHostVss/NicTeamingPolicy.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | enum NicTeamingPolicy { 18 | Loadbalance_ip 19 | Loadbalance_srcmac 20 | Loadbalance_srcid 21 | Failover_explicit 22 | Unset 23 | } 24 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/Enums/VMSwapfilePolicy.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | enum VMSwapfilePolicy { 18 | InHostDatastore 19 | WithVM 20 | Unset 21 | } 22 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/Enums/VsanDataMigrationMode.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | enum VsanDataMigrationMode { 18 | Full 19 | EnsureAccessibility 20 | NoDataMigration 21 | Unset 22 | } 23 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/RequiredModules.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | RequiredModules = @( 18 | #@{ "ModuleName" = "VMware.VimAutomation.Vds"; "ModuleVersion" = "11.2.0.12483615" }, 19 | #@{ "ModuleName" = "VMware.VimAutomation.Storage"; "ModuleVersion" = "11.5.0.14901686" } 20 | ) 21 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/Tests/Integration/Configurations/PowerCLISettings/PowerCLISettings_Config.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | $moduleFolderPath = (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 18 | $integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration' 19 | 20 | Configuration PowerCLISettings_Config { 21 | Import-DscResource -ModuleName VMware.vSphereDSC 22 | 23 | Node localhost { 24 | PowerCLISettings powerCLISettings { 25 | SettingsScope = 'LCM' 26 | ParticipateInCeip = $false 27 | InvalidCertificateAction = 'Warn' 28 | DefaultVIServerMode = 'Multiple' 29 | DisplayDeprecationWarnings = $false 30 | } 31 | } 32 | } 33 | 34 | PowerCLISettings_Config -OutputPath "$integrationTestsFolderPath\PowerCLISettings_Config" 35 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/Tests/Integration/Configurations/VMHostAcceptanceLevel/VMHostAcceptanceLevel_Config.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | Configuration VMHostAcceptanceLevel_ModifyVMHostAcceptanceLevel_Config { 18 | Import-DscResource -ModuleName VMware.vSphereDSC 19 | 20 | Node $AllNodes.NodeName { 21 | VMHostAcceptanceLevel $AllNodes.VMHostAcceptanceLevelResourceName { 22 | Server = $AllNodes.Server 23 | Credential = $AllNodes.Credential 24 | Name = $AllNodes.Name 25 | Level = $AllNodes.VMHostAcceptanceLevel 26 | } 27 | } 28 | } 29 | 30 | Configuration VMHostAcceptanceLevel_ModifyVMHostAcceptanceLevelToInitialState_Config { 31 | Import-DscResource -ModuleName VMware.vSphereDSC 32 | 33 | Node $AllNodes.NodeName { 34 | VMHostAcceptanceLevel $AllNodes.VMHostAcceptanceLevelResourceName { 35 | Server = $AllNodes.Server 36 | Credential = $AllNodes.Credential 37 | Name = $AllNodes.Name 38 | Level = $AllNodes.InitialVMHostAcceptanceLevel 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/Tests/Integration/Configurations/VMHostDCUIKeyboard/VMHostDCUIKeyboard_Config.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | Configuration VMHostDCUIKeyboard_ModifyVMHostDCUIKeyboardLayout_Config { 18 | Import-DscResource -ModuleName VMware.vSphereDSC 19 | 20 | Node $AllNodes.NodeName { 21 | VMHostDCUIKeyboard $AllNodes.VMHostDCUIKeyboardResourceName { 22 | Server = $AllNodes.Server 23 | Credential = $AllNodes.Credential 24 | Name = $AllNodes.VMHostName 25 | Layout = $AllNodes.VMHostDCUIKeyboardLayout 26 | } 27 | } 28 | } 29 | 30 | Configuration VMHostDCUIKeyboard_ModifyVMHostDCUIKeyboardLayoutToInitialState_Config { 31 | Import-DscResource -ModuleName VMware.vSphereDSC 32 | 33 | Node $AllNodes.NodeName { 34 | VMHostDCUIKeyboard $AllNodes.VMHostDCUIKeyboardResourceName { 35 | Server = $AllNodes.Server 36 | Credential = $AllNodes.Credential 37 | Name = $AllNodes.VMHostName 38 | Layout = $AllNodes.InitialVMHostDCUIKeyboardLayout 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/Tests/Integration/Configurations/VMHostNetworkCoreDump/VMHostNetworkCoreDump_Config.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | Configuration VMHostNetworkCoreDump_ModifyVMHostNetworkCoreDumpConfiguration_Config { 18 | Import-DscResource -ModuleName VMware.vSphereDSC 19 | 20 | Node $AllNodes.NodeName { 21 | VMHostNetworkCoreDump $AllNodes.VMHostNetworkCoreDumpResourceName { 22 | Server = $AllNodes.Server 23 | Credential = $AllNodes.Credential 24 | Name = $AllNodes.Name 25 | Enable = $AllNodes.EnableNetworkCoreDump 26 | InterfaceName = $AllNodes.NetworkCoreDumpInterfaceName 27 | ServerIp = $AllNodes.NetworkCoreDumpServerIp 28 | ServerPort = $AllNodes.NetworkCoreDumpServerPort 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/Tests/Integration/EsxCli/VMHostAcceptanceLevel/VMHostAcceptanceLevel.Integration.Tests.Helpers.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | <# 18 | .DESCRIPTION 19 | 20 | Retrieves the initial acceptance level of the specified VMHost before the execution of the Integration Tests. 21 | #> 22 | function Get-InitialVMHostAcceptanceLevel { 23 | [CmdletBinding()] 24 | [OutputType([string])] 25 | 26 | $viServer = Connect-VIServer -Server $Server -Credential $Credential -ErrorAction Stop -Verbose:$false 27 | 28 | $vmHost = Get-VMHost -Server $viServer -Name $Name -ErrorAction Stop -Verbose:$false 29 | $esxCli = Get-EsxCli -Server $viServer -VMHost $vmHost -V2 -ErrorAction Stop -Verbose:$false 30 | 31 | $initialVMHostAcceptanceLevel = $esxCli.software.acceptance.get.Invoke() 32 | 33 | Disconnect-VIServer -Server $Server -Confirm:$false -ErrorAction Stop -Verbose:$false 34 | 35 | $initialVMHostAcceptanceLevel 36 | } 37 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/Tests/Integration/EsxCli/VMHostDCUIKeyboard/VMHostDCUIKeyboard.Integration.Tests.Helpers.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | <# 18 | .DESCRIPTION 19 | 20 | Retrieves the Keyboard Layout for the DCUI of the VMHost before the execution of the Integration Tests. 21 | #> 22 | function Get-InitialVMHostDCUIKeyboardLayout { 23 | [CmdletBinding()] 24 | [OutputType([string])] 25 | 26 | $vmHostDCUIKeyboardLayout = $null 27 | 28 | $viServer = Connect-VIServer -Server $Server -Credential $Credential -ErrorAction Stop -Verbose:$false 29 | 30 | $vmHost = Get-VMHost -Server $viServer -Name $Name -ErrorAction Stop -Verbose:$false 31 | $esxCli = Get-EsxCli -Server $viServer -VMHost $vmHost -V2 -ErrorAction Stop -Verbose:$false 32 | 33 | $vmHostDCUIKeyboardLayout = $esxCli.system.settings.keyboard.layout.get.Invoke() 34 | 35 | Disconnect-VIServer -Server $Server -Confirm:$false -ErrorAction Stop -Verbose:$false 36 | 37 | $vmHostDCUIKeyboardLayout 38 | } 39 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/Tests/Integration/EsxCli/VMHostNetworkCoreDump/VMHostNetworkCoreDump.Integration.Tests.Helpers.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | <# 18 | .DESCRIPTION 19 | 20 | Retrieves the name of a VMKernel Network Adapter on the specified VMHost before the execution of the Integration Tests. 21 | #> 22 | function Get-VMKernelNetworkAdapterName { 23 | [CmdletBinding()] 24 | [OutputType([string])] 25 | 26 | $viServer = Connect-VIServer -Server $Server -Credential $Credential -ErrorAction Stop -Verbose:$false 27 | 28 | $vmHost = Get-VMHost -Server $viServer -Name $Name -ErrorAction Stop -Verbose:$false 29 | $vmHostVMKernelNetworkAdapter = Get-VMHostNetworkAdapter -Server $viServer -VMHost $vmHost -VMKernel -ErrorAction Stop -Verbose:$false | Select-Object -First 1 30 | 31 | Disconnect-VIServer -Server $Server -Confirm:$false -ErrorAction Stop -Verbose:$false 32 | 33 | $vmHostVMKernelNetworkAdapter.Name 34 | } 35 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/Tests/Integration/EsxCli/VMHostVMKernelDumpFile/VMHostVMKernelDumpFile.Integration.Tests.Helpers.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | <# 18 | .DESCRIPTION 19 | 20 | Retrieves the canonical name of the Scsi logical unit that will contain the Vmfs Datastore used in the Integration Tests. 21 | #> 22 | function Get-ScsiLunCanonicalName { 23 | [CmdletBinding()] 24 | [OutputType([string])] 25 | 26 | $viServer = Connect-VIServer -Server $Server -Credential $Credential -ErrorAction Stop -Verbose:$false 27 | 28 | $vmHost = Get-VMHost -Server $viServer -Name $Name -ErrorAction Stop -Verbose:$false 29 | $datastoreSystem = Get-View -Server $viServer -Id $vmHost.ExtensionData.ConfigManager.DatastoreSystem -ErrorAction Stop -Verbose:$false 30 | $scsiLun = $datastoreSystem.QueryAvailableDisksForVmfs($null) | Select-Object -First 1 31 | 32 | if ($null -eq $scsiLun) { 33 | throw 'The Vmfs Datastore that is used in the Integration Tests requires one unused Scsi logical unit to be available.' 34 | } 35 | 36 | Disconnect-VIServer -Server $Server -Confirm:$false -ErrorAction Stop -Verbose:$false 37 | 38 | $scsiLun.CanonicalName 39 | } 40 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/Tests/Integration/EsxCli/VMHostvSANNetworkConfiguration/VMHostvSANNetworkConfiguration.Integration.Tests.Helpers.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | <# 18 | .DESCRIPTION 19 | 20 | Retrieves the name of a VMKernel Network Adapter on the specified VMHost before the execution of the Integration Tests. 21 | #> 22 | function Get-VMKernelNetworkAdapterName { 23 | [CmdletBinding()] 24 | [OutputType([string])] 25 | 26 | $viServer = Connect-VIServer -Server $Server -Credential $Credential -ErrorAction Stop -Verbose:$false 27 | 28 | $vmHost = Get-VMHost -Server $viServer -Name $Name -ErrorAction Stop -Verbose:$false 29 | $vmHostVMKernelNetworkAdapter = Get-VMHostNetworkAdapter -Server $viServer -VMHost $vmHost -VMKernel -ErrorAction Stop -Verbose:$false | Select-Object -First 1 30 | 31 | Disconnect-VIServer -Server $Server -Confirm:$false -ErrorAction Stop -Verbose:$false 32 | 33 | $vmHostVMKernelNetworkAdapter.Name 34 | } 35 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/Tests/Integration/VMHostNetwork/VMHostIPRoute/VMHostIPRoute.Integration.Tests.Helpers.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | <# 18 | .DESCRIPTION 19 | 20 | Retrieves the Default Gateway of the specified VMHost. 21 | #> 22 | function Get-VMHostDefaultGateway { 23 | [CmdletBinding()] 24 | [OutputType([string])] 25 | 26 | $viServer = Connect-VIServer -Server $Server -Credential $Credential -ErrorAction Stop -Verbose:$false 27 | 28 | $vmHost = Get-VMHost -Server $viServer -Name $Name -ErrorAction Stop -Verbose:$false 29 | $vmHostDefaultGateway = $vmHost.ExtensionData.Config.Network.IpRouteConfig.DefaultGateway 30 | 31 | Disconnect-VIServer -Server $Server -Confirm:$false -ErrorAction Stop -Verbose:$false 32 | 33 | $vmHostDefaultGateway 34 | } 35 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/Tests/IntegrationTests.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | param( 18 | [Parameter(Mandatory = $true)] 19 | [string] 20 | $Name, 21 | 22 | [Parameter(Mandatory = $true)] 23 | [string] 24 | $Server, 25 | 26 | [Parameter(Mandatory = $true)] 27 | [string] 28 | $User, 29 | 30 | [Parameter(Mandatory = $true)] 31 | [string] 32 | $Password 33 | ) 34 | 35 | $moduleFolderPath = (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 36 | $integrationTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Integration' 37 | 38 | Invoke-Pester -Script @{ 39 | Path = "$integrationTestsFolderPath\*" 40 | Parameters = @{ Name = $Name; Server = $Server; Password = $Password; User = $User } 41 | } 42 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/Tests/TestRunner.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | param ( 18 | [Parameter(Mandatory = $false)] 19 | [switch] $Unit, 20 | 21 | [Parameter(Mandatory = $false)] 22 | [switch] $Integration 23 | ) 24 | 25 | try { 26 | $moduleFolderPath = (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 27 | $moduleTestsFolderPath = Join-Path $moduleFolderPath 'Tests' 28 | 29 | if (($Unit -and $Integration) -or (!$Unit -and !$Integration)) { 30 | Start-Process -FilePath "powershell.exe" -ArgumentList "& '$moduleTestsFolderPath\UnitTests.ps1'" -Wait -NoNewWindow 31 | Start-Process -FilePath "powershell.exe" -ArgumentList "& '$moduleTestsFolderPath\IntegrationTests.ps1'" -Wait -NoNewWindow 32 | } 33 | elseif ($Unit) { 34 | Start-Process -FilePath "powershell.exe" -ArgumentList "& '$moduleTestsFolderPath\UnitTests.ps1'" -Wait -NoNewWindow 35 | } 36 | else { 37 | Start-Process -FilePath "powershell.exe" -ArgumentList "& '$moduleTestsFolderPath\IntegrationTests.ps1'" -Wait -NoNewWindow 38 | } 39 | } 40 | catch { 41 | Write-Error "Ran into an issue: $($PSItem.ToString())" 42 | } 43 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/Tests/Unit/VMHostStorage/VMHostStorage.Mocks.Data.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | $script:Constants = @{ 18 | VIServer = '10.23.112.235' 19 | VIServerUser = 'Admin1' 20 | VIServerPassword = 'Password1' | ConvertTo-SecureString -AsPlainText -Force 21 | VMHostName = 'DscVMHost' 22 | SoftwareIScsiEnabled = $true 23 | } 24 | 25 | $script:Credential = New-Object System.Management.Automation.PSCredential($script:Constants.VIServerUser, $script:Constants.VIServerPassword) 26 | 27 | $script:VIServer = [VMware.VimAutomation.ViCore.Impl.V1.VIServerImpl] @{ 28 | Name = $script:Constants.VIServer 29 | User = $script:Constants.VIServerUser 30 | } 31 | 32 | $script:VMHost = [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl] @{ 33 | Name = $script:Constants.VMHostName 34 | } 35 | 36 | $script:VMHostStorage = [VMware.VimAutomation.ViCore.Impl.V1.Host.Storage.VMHostStorageInfoImpl] @{ 37 | VMHost = $script:VMHost 38 | SoftwareIScsiEnabled = $script:Constants.SoftwareIScsiEnabled 39 | } 40 | -------------------------------------------------------------------------------- /Source/VMware.vSphereDSC/Tests/UnitTests.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) 2018-2021 VMware, Inc. All rights reserved 3 | 4 | The BSD-2 license (the "License") set forth below applies to all parts of the Desired State Configuration Resources for VMware project. You may not use this file except in compliance with the License. 5 | 6 | BSD-2 License 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | #> 16 | 17 | $moduleFolderPath = (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 18 | $unitTestsFolderPath = Join-Path (Join-Path $moduleFolderPath 'Tests') 'Unit' 19 | 20 | Invoke-Pester -Path "$unitTestsFolderPath\*" -CodeCoverage @{ Path = "$moduleFolderPath\VMware.vSphereDSC.psm1" } 21 | --------------------------------------------------------------------------------