Last active
January 15, 2017 18:59
-
-
Save nohwnd/61c36ace27f09133339433b7502de0ff to your computer and use it in GitHub Desktop.
Create tag category
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$r = "c:\Program Files (x86)\VMware\Infrastructure\PowerCLI\Modules\VMware.VimAutomation.Sdk\VMware.VimAutomation.Sdk.Types.dll", | |
"c:\Program Files (x86)\VMware\Infrastructure\PowerCLI\Modules\VMware.VimAutomation.Core\VMware.VimAutomation.ViCore.Types.dll" | |
Add-Type -ReferencedAssemblies $r -typeDefinition " | |
using VMware.VimAutomation.ViCore.Types.V1; | |
using VMware.VimAutomation.ViCore.Types.V1.Tagging; | |
namespace Mocks | |
{ | |
public class MockTagCategory : TagCategory | |
{ | |
public string Id { get; set; } | |
public string Name { get; set; } | |
public string Description { get; set; } | |
public Cardinality Cardinality { get; set; } | |
public string[] EntityType { get; set; } | |
public string Uid { get; set; } | |
} | |
}" | |
$tagCategory = new-object Mocks.MockTagCategory | |
$tagCategory -is [VMware.VimAutomation.ViCore.Types.V1.Tagging.TagCategory] | |
$tagCategory.Name = "my mock category" | |
$tagCategory |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment