Compare commits
399 Commits
rCisTag-mo
...
AccessUpda
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
500e4022e7 | ||
|
|
20f387d2cf | ||
|
|
adba00b7e8 | ||
|
|
3d74470c70 | ||
|
|
23ad3e0f64 | ||
|
|
21182d762b | ||
|
|
747190c33d | ||
|
|
c5c836d3d6 | ||
|
|
31fa1244fd | ||
|
|
46c3a91c9d | ||
|
|
3cf69178d5 | ||
|
|
f3c549a867 | ||
|
|
aa8d5e3c26 | ||
|
|
926260096f | ||
|
|
233c220dd6 | ||
|
|
e45aa0171d | ||
|
|
41f6194fdb | ||
|
|
98ae307c1f | ||
|
|
5d570cb0df | ||
|
|
a70e324282 | ||
|
|
1715d94892 | ||
|
|
e61587ac9b | ||
|
|
b940759bbf | ||
|
|
6da888fd19 | ||
|
|
118739b8fb | ||
|
|
33e038bbba | ||
|
|
1b0dd9f42e | ||
|
|
3f430900cf | ||
|
|
b1fa944909 | ||
|
|
22f0926161 | ||
|
|
9db267a14c | ||
|
|
1d251bde8a | ||
|
|
254e062e52 | ||
|
|
2182f6ba6f | ||
|
|
9c62ed266e | ||
|
|
39cc775d25 | ||
|
|
0d4ba8b4dc | ||
|
|
adfe78f236 | ||
|
|
fa9a3c5026 | ||
|
|
7a39d28314 | ||
|
|
ab266189c2 | ||
|
|
6797eb8156 | ||
|
|
5e66c56742 | ||
|
|
ddde669037 | ||
|
|
39499c240b | ||
|
|
a8a98e098e | ||
|
|
03272c1d2d | ||
|
|
5c210f3839 | ||
|
|
f11b9bd485 | ||
|
|
31e3accfe1 | ||
|
|
a7ff78fee0 | ||
|
|
1a3e397661 | ||
|
|
f83ceec0e8 | ||
|
|
c1e181ea11 | ||
|
|
dc74d06a9c | ||
|
|
478d913779 | ||
|
|
c7fcb1b186 | ||
|
|
ffe7d86921 | ||
|
|
764123f903 | ||
|
|
4d399cc5ef | ||
|
|
f50c067e80 | ||
|
|
49c0b44beb | ||
|
|
39a8539d97 | ||
|
|
ae16ef6e52 | ||
|
|
1b7ea80342 | ||
|
|
c506bf400a | ||
|
|
81763c04c2 | ||
|
|
e33fdc3453 | ||
|
|
8b40cf94ec | ||
|
|
03f685980f | ||
|
|
ef84482ee3 | ||
|
|
b7e1d95e83 | ||
|
|
35095fbea7 | ||
|
|
46db5d0f50 | ||
|
|
323b9e88f7 | ||
|
|
7bd49b7779 | ||
|
|
44fbae8d08 | ||
|
|
23a6bcf09b | ||
|
|
c49cf2f721 | ||
|
|
3653dd09bc | ||
|
|
fef2f32adf | ||
|
|
9de3195b32 | ||
|
|
0ba0b870af | ||
|
|
2c79a86531 | ||
|
|
5325596b2f | ||
|
|
f703e1c275 | ||
|
|
ff54be27cd | ||
|
|
db5cd60916 | ||
|
|
0cfbf635e7 | ||
|
|
cbf397df24 | ||
|
|
337dc077a9 | ||
|
|
5f6294cf67 | ||
|
|
10647481f1 | ||
|
|
4badbe5ff5 | ||
|
|
4436510b02 | ||
|
|
0887967dc3 | ||
|
|
9854561591 | ||
|
|
908f0ee95f | ||
|
|
823e150ef7 | ||
|
|
ee017eb822 | ||
|
|
723acfd811 | ||
|
|
a849a67527 | ||
|
|
64db788986 | ||
|
|
864a6446f0 | ||
|
|
e7222d13f7 | ||
|
|
b3e9ffc51d | ||
|
|
e9e8a14f19 | ||
|
|
b5563cc11a | ||
|
|
30fc960778 | ||
|
|
9c8a928cd7 | ||
|
|
c1cc32db4b | ||
|
|
5f3f41ff44 | ||
|
|
93e61262ff | ||
|
|
fde0627160 | ||
|
|
2a5eff4fd1 | ||
|
|
72864b7860 | ||
|
|
5f1a86e78b | ||
|
|
0576034d74 | ||
|
|
e8fdf541d4 | ||
|
|
f55ffc3b20 | ||
|
|
4c23a8a5d6 | ||
|
|
50559d9c6d | ||
|
|
6f22da7f67 | ||
|
|
c91a764ffe | ||
|
|
975a7baf8d | ||
|
|
f4fc007bd5 | ||
|
|
11181a95ec | ||
|
|
9e33329a96 | ||
|
|
4c9fab7b6c | ||
|
|
fd7429055d | ||
|
|
3134d1acd9 | ||
|
|
942db3940d | ||
|
|
a9d6acc44b | ||
|
|
19d6151380 | ||
|
|
2cebd97c01 | ||
|
|
25450e9003 | ||
|
|
f2b9ac0647 | ||
|
|
0cfb39779b | ||
|
|
423e752404 | ||
|
|
b95886558f | ||
|
|
3b5f501d72 | ||
|
|
db8f4407a0 | ||
|
|
31d785fc14 | ||
|
|
1760d4c963 | ||
|
|
d12619c64d | ||
|
|
528eca815c | ||
|
|
74dd5ef9fb | ||
|
|
45ac4a47fb | ||
|
|
fe603f60d6 | ||
|
|
1c54a37fbd | ||
|
|
d95806ea2f | ||
|
|
bda5a5a276 | ||
|
|
72a5555860 | ||
|
|
29fbb5bc59 | ||
|
|
360e190300 | ||
|
|
b8b48e40f8 | ||
|
|
ecc12a1884 | ||
|
|
71915cde79 | ||
|
|
0e318d3e07 | ||
|
|
780e830205 | ||
|
|
2212477dff | ||
|
|
481845717c | ||
|
|
407be173e4 | ||
|
|
6cc6634628 | ||
|
|
9ff4c4f48c | ||
|
|
216ee7386f | ||
|
|
ff3d297e69 | ||
|
|
59ab2785e3 | ||
|
|
5efdf01810 | ||
|
|
24556bbe19 | ||
|
|
83899d2b7b | ||
|
|
e35e17a04d | ||
|
|
9073d8f3b2 | ||
|
|
a2fef29a71 | ||
|
|
d758b5ba4c | ||
|
|
0d75606d99 | ||
|
|
a2c896b81b | ||
|
|
16528c92b8 | ||
|
|
9845e9d16b | ||
|
|
5571a8900a | ||
|
|
25cfffa14f | ||
|
|
06d018c7a6 | ||
|
|
e6a4c09e6d | ||
|
|
81e60245d0 | ||
|
|
4652495ece | ||
|
|
8953a512fe | ||
|
|
bfbcbc8faa | ||
|
|
bf33a58232 | ||
|
|
44879d8c25 | ||
|
|
334f58476c | ||
|
|
3372f3faf3 | ||
|
|
c906e8a772 | ||
|
|
faa125fd83 | ||
|
|
0246451fe6 | ||
|
|
9f851b38a1 | ||
|
|
dcc04b8d88 | ||
|
|
5dc0145c92 | ||
|
|
726eb7e181 | ||
|
|
c384c84892 | ||
|
|
70edda9043 | ||
|
|
82c7889cec | ||
|
|
76eadeba8a | ||
|
|
ac650e4a36 | ||
|
|
bd983dcd7f | ||
|
|
cea57f11d5 | ||
|
|
c7a19c795e | ||
|
|
e5920d40f5 | ||
|
|
4ef4cce5ef | ||
|
|
53b8377c53 | ||
|
|
f9953ec994 | ||
|
|
937f213451 | ||
|
|
7c7f8d3fbf | ||
|
|
971e4aeec7 | ||
|
|
0caddf91fa | ||
|
|
560739222d | ||
|
|
3e28c516a7 | ||
|
|
1ce8b927ce | ||
|
|
82b32df293 | ||
|
|
0743c67799 | ||
|
|
cb9e57e185 | ||
|
|
374baa8c7f | ||
|
|
ce32e7ab1d | ||
|
|
bcff03c896 | ||
|
|
37c9effbd7 | ||
|
|
a7b81266bd | ||
|
|
b5d8306bd4 | ||
|
|
56cab055f6 | ||
|
|
934fcc45af | ||
|
|
578d3c5deb | ||
|
|
3904b416b3 | ||
|
|
b68dc6c4e0 | ||
|
|
48d2db91d8 | ||
|
|
501bfa7fd2 | ||
|
|
4246cfc71f | ||
|
|
0581d89cbe | ||
|
|
b25c280714 | ||
|
|
82b5b2eb1e | ||
|
|
ea4ab5f61d | ||
|
|
ed5b8eaf5e | ||
|
|
2bb2cd451f | ||
|
|
3a1afa39fa | ||
|
|
8402e69993 | ||
|
|
a1c3c01f05 | ||
|
|
5052044ae1 | ||
|
|
3a022777d3 | ||
|
|
179cfa82be | ||
|
|
39c179ae1a | ||
|
|
691709dd40 | ||
|
|
16b32f1b03 | ||
|
|
526f6a8ad9 | ||
|
|
e8b64517c7 | ||
|
|
9e569b139a | ||
|
|
5ee5c5d09a | ||
|
|
21fe9a8d55 | ||
|
|
9c427a4886 | ||
|
|
14ecf2107d | ||
|
|
10f1f26ec1 | ||
|
|
9a4acf5c57 | ||
|
|
2103438f8a | ||
|
|
c49f893044 | ||
|
|
4c88b337aa | ||
|
|
e51b3050e2 | ||
|
|
b32256de5f | ||
|
|
c34b602bf3 | ||
|
|
5b74c582b7 | ||
|
|
33bb7f6b3a | ||
|
|
75a2562d97 | ||
|
|
a753d8251b | ||
|
|
760c534cf7 | ||
|
|
127252196f | ||
|
|
7086f2c823 | ||
|
|
dc191995f3 | ||
|
|
cca008ed27 | ||
|
|
1f6ec2c2c2 | ||
|
|
3c5e8363ed | ||
|
|
cff2f29b97 | ||
|
|
3d29306cb6 | ||
|
|
121c1bd2db | ||
|
|
a332102392 | ||
|
|
3366bb25e0 | ||
|
|
7b22e46772 | ||
|
|
a36bdf923d | ||
|
|
8ae75925af | ||
|
|
61a9929bca | ||
|
|
50b76efef6 | ||
|
|
a24fbf4e95 | ||
|
|
fc270dc256 | ||
|
|
348eb1899e | ||
|
|
b096ace8ae | ||
|
|
fe6932a5fe | ||
|
|
ad76a77c20 | ||
|
|
3eb90cf148 | ||
|
|
c2261080ff | ||
|
|
355d499301 | ||
|
|
d9768c21ac | ||
|
|
2200c4d25d | ||
|
|
f567922869 | ||
|
|
e345493124 | ||
|
|
e36208e2db | ||
|
|
189dbd13b5 | ||
|
|
b88f3a286a | ||
|
|
a8b54df5ff | ||
|
|
0a1e5a65c3 | ||
|
|
dd5f70caca | ||
|
|
2c23ecb414 | ||
|
|
eff217ab5d | ||
|
|
b90c1ecad0 | ||
|
|
3dda8cc639 | ||
|
|
c09c40b8b2 | ||
|
|
de8d765719 | ||
|
|
de1197d0e6 | ||
|
|
40026511e9 | ||
|
|
8c0e1985b1 | ||
|
|
8dbea3ac24 | ||
|
|
73d7eaa992 | ||
|
|
642e83e6fd | ||
|
|
aaae686d7c | ||
|
|
69397e76ce | ||
|
|
3121a12808 | ||
|
|
e2ad078168 | ||
|
|
c6607eb188 | ||
|
|
e5c0d95cb0 | ||
|
|
fb5c9e248a | ||
|
|
7c28fbc894 | ||
|
|
60217aaa5c | ||
|
|
748adc6f27 | ||
|
|
83b4f78c72 | ||
|
|
e83d70081c | ||
|
|
8694c40210 | ||
|
|
f4ba11fe75 | ||
|
|
056df11512 | ||
|
|
9d929431b0 | ||
|
|
f584dae11e | ||
|
|
5852e5bf7f | ||
|
|
948a5539a9 | ||
|
|
fc02a60eaf | ||
|
|
95138e128f | ||
|
|
60aafba7ae | ||
|
|
3b44fbcf20 | ||
|
|
9bd66f1a66 | ||
|
|
049e621fb6 | ||
|
|
29719d6ca7 | ||
|
|
13649b8e35 | ||
|
|
df9d71d4e0 | ||
|
|
d70bee9f99 | ||
|
|
d4f4e64ca3 | ||
|
|
c4c92f7a87 | ||
|
|
d987a7535b | ||
|
|
373b909095 | ||
|
|
054d127f12 | ||
|
|
7235de655d | ||
|
|
245cacae25 | ||
|
|
cdff3035cc | ||
|
|
c265c50447 | ||
|
|
969d31fcfb | ||
|
|
5a0bb408ba | ||
|
|
fa6be16f34 | ||
|
|
bad590dbc2 | ||
|
|
a68325cc50 | ||
|
|
009a298bff | ||
|
|
58c110be5a | ||
|
|
b2d62e84ad | ||
|
|
f8d285e9b5 | ||
|
|
03041fea20 | ||
|
|
e240f04de9 | ||
|
|
aaed5597d6 | ||
|
|
08cbf5276c | ||
|
|
9282c79c86 | ||
|
|
74dcf88b05 | ||
|
|
e53df3dc57 | ||
|
|
cda9bd36e1 | ||
|
|
a6f8d7db15 | ||
|
|
1fef21bad6 | ||
|
|
f7da4a963f | ||
|
|
f0f5ec7967 | ||
|
|
0109a2d0d2 | ||
|
|
5dfaf81e73 | ||
|
|
e73ababdcc | ||
|
|
f1669f8794 | ||
|
|
3e50b4ebde | ||
|
|
9c2b190faa | ||
|
|
a4a976e835 | ||
|
|
e887ac3152 | ||
|
|
8a4abe7dd4 | ||
|
|
a9c83ab50a | ||
|
|
e0e4a56826 | ||
|
|
cd2e8503ba | ||
|
|
61aead2685 | ||
|
|
4c645a7393 | ||
|
|
ecdd19911f | ||
|
|
5e844cf2cf | ||
|
|
b21e3d4fc0 | ||
|
|
5bee9abf62 | ||
|
|
02286dbe53 | ||
|
|
23f215be35 | ||
|
|
7217cec777 | ||
|
|
b5800f0eff | ||
|
|
dd9a0a16fa | ||
|
|
b39e6394db |
@@ -2,10 +2,10 @@
|
||||
<#
|
||||
.NOTES
|
||||
===========================================================================
|
||||
Created by: William Lam
|
||||
Organization: VMware
|
||||
Blog: www.virtuallyghetto.com
|
||||
Twitter: @lamw
|
||||
Created by: William Lam
|
||||
Organization: VMware
|
||||
Blog: www.virtuallyghetto.com
|
||||
Twitter: @lamw
|
||||
===========================================================================
|
||||
.DESCRIPTION
|
||||
This function lists all available vSphere Content Libaries
|
||||
@@ -20,12 +20,12 @@
|
||||
[Parameter(Mandatory=$false)][String]$LibraryName
|
||||
)
|
||||
|
||||
$contentLibaryService = Get-CisService com.vmware.content.library
|
||||
$libaryIDs = $contentLibaryService.list()
|
||||
$contentLibraryService = Get-CisService com.vmware.content.library
|
||||
$LibraryIDs = $contentLibraryService.list()
|
||||
|
||||
$results = @()
|
||||
foreach($libraryID in $libaryIDs) {
|
||||
$library = $contentLibaryService.get($libraryID)
|
||||
foreach($libraryID in $LibraryIDs) {
|
||||
$library = $contentLibraryService.get($libraryID)
|
||||
|
||||
# Use vCenter REST API to retrieve name of Datastore that is backing the Content Library
|
||||
$datastoreService = Get-CisService com.vmware.vcenter.datastore
|
||||
@@ -87,10 +87,10 @@ Function Get-ContentLibraryItems {
|
||||
<#
|
||||
.NOTES
|
||||
===========================================================================
|
||||
Created by: William Lam
|
||||
Organization: VMware
|
||||
Blog: www.virtuallyghetto.com
|
||||
Twitter: @lamw
|
||||
Created by: William Lam
|
||||
Organization: VMware
|
||||
Blog: www.virtuallyghetto.com
|
||||
Twitter: @lamw
|
||||
===========================================================================
|
||||
.DESCRIPTION
|
||||
This function lists all items within a given vSphere Content Library
|
||||
@@ -108,18 +108,18 @@ Function Get-ContentLibraryItems {
|
||||
[Parameter(Mandatory=$false)][String]$LibraryItemName
|
||||
)
|
||||
|
||||
$contentLibaryService = Get-CisService com.vmware.content.library
|
||||
$libaryIDs = $contentLibaryService.list()
|
||||
$contentLibraryService = Get-CisService com.vmware.content.library
|
||||
$LibraryIDs = $contentLibraryService.list()
|
||||
|
||||
$results = @()
|
||||
foreach($libraryID in $libaryIDs) {
|
||||
$library = $contentLibaryService.get($libraryId)
|
||||
foreach($libraryID in $LibraryIDs) {
|
||||
$library = $contentLibraryService.get($libraryId)
|
||||
if($library.name -eq $LibraryName) {
|
||||
$contentLibaryItemService = Get-CisService com.vmware.content.library.item
|
||||
$itemIds = $contentLibaryItemService.list($libraryID)
|
||||
$contentLibraryItemService = Get-CisService com.vmware.content.library.item
|
||||
$itemIds = $contentLibraryItemService.list($libraryID)
|
||||
|
||||
foreach($itemId in $itemIds) {
|
||||
$item = $contentLibaryItemService.get($itemId)
|
||||
$item = $contentLibraryItemService.get($itemId)
|
||||
|
||||
if(!$LibraryItemName) {
|
||||
$itemResult = [pscustomobject] @{
|
||||
@@ -158,10 +158,10 @@ Function Get-ContentLibraryItemFiles {
|
||||
<#
|
||||
.NOTES
|
||||
===========================================================================
|
||||
Created by: William Lam
|
||||
Organization: VMware
|
||||
Blog: www.virtuallyghetto.com
|
||||
Twitter: @lamw
|
||||
Created by: William Lam
|
||||
Organization: VMware
|
||||
Blog: www.virtuallyghetto.com
|
||||
Twitter: @lamw
|
||||
===========================================================================
|
||||
.DESCRIPTION
|
||||
This function lists all item files within a given vSphere Content Library
|
||||
@@ -179,28 +179,40 @@ Function Get-ContentLibraryItemFiles {
|
||||
[Parameter(Mandatory=$false)][String]$LibraryItemName
|
||||
)
|
||||
|
||||
$contentLibaryService = Get-CisService com.vmware.content.library
|
||||
$libaryIDs = $contentLibaryService.list()
|
||||
$contentLibraryService = Get-CisService com.vmware.content.library
|
||||
$libraryIDs = $contentLibraryService.list()
|
||||
|
||||
$results = @()
|
||||
foreach($libraryID in $libaryIDs) {
|
||||
$library = $contentLibaryService.get($libraryId)
|
||||
foreach($libraryID in $libraryIDs) {
|
||||
$library = $contentLibraryService.get($libraryId)
|
||||
if($library.name -eq $LibraryName) {
|
||||
$contentLibaryItemService = Get-CisService com.vmware.content.library.item
|
||||
$itemIds = $contentLibaryItemService.list($libraryID)
|
||||
$contentLibraryItemService = Get-CisService com.vmware.content.library.item
|
||||
$itemIds = $contentLibraryItemService.list($libraryID)
|
||||
$DatastoreID = $library.storage_backings.datastore_id.Value
|
||||
$Datastore = get-datastore -id "Datastore-$DatastoreID"
|
||||
|
||||
foreach($itemId in $itemIds) {
|
||||
$itemName = ($contentLibaryItemService.get($itemId)).name
|
||||
$contenLibraryItemFileSerice = Get-CisService com.vmware.content.library.item.file
|
||||
$files = $contenLibraryItemFileSerice.list($itemId)
|
||||
$itemName = ($contentLibraryItemService.get($itemId)).name
|
||||
$contentLibraryItemFileSerice = Get-CisService com.vmware.content.library.item.file
|
||||
$files = $contentLibraryItemFileSerice.list($itemId)
|
||||
$contentLibraryItemStorageService = Get-CisService com.vmware.content.library.item.storage
|
||||
|
||||
foreach($file in $files) {
|
||||
if($contentLibraryItemStorageService.get($itemId, $($file.name)).storage_backing.type -eq "DATASTORE"){
|
||||
$filepath = $contentLibraryItemStorageService.get($itemId, $($file.name)).storage_uris.segments -notmatch '(^/$|^vmfs$*|^volumes$*|vsan:.*)' -join ''
|
||||
$fullfilepath = "[$($datastore.name)] $filepath"
|
||||
}
|
||||
else{
|
||||
$fullfilepath = "UNKNOWN"
|
||||
}
|
||||
|
||||
if(!$LibraryItemName) {
|
||||
$fileResult = [pscustomobject] @{
|
||||
Name = $file.name;
|
||||
Version = $file.version;
|
||||
Size = $file.size;
|
||||
Stored = $file.cached;
|
||||
Path = $fullfilepath;
|
||||
}
|
||||
$results+=$fileResult
|
||||
} else {
|
||||
@@ -210,6 +222,7 @@ Function Get-ContentLibraryItemFiles {
|
||||
Version = $file.version;
|
||||
Size = $file.size;
|
||||
Stored = $file.cached;
|
||||
Path = $fullfilepath;
|
||||
}
|
||||
$results+=$fileResult
|
||||
}
|
||||
@@ -225,10 +238,10 @@ Function Set-ContentLibrary {
|
||||
<#
|
||||
.NOTES
|
||||
===========================================================================
|
||||
Created by: William Lam
|
||||
Organization: VMware
|
||||
Blog: www.virtuallyghetto.com
|
||||
Twitter: @lamw
|
||||
Created by: William Lam
|
||||
Organization: VMware
|
||||
Blog: www.virtuallyghetto.com
|
||||
Twitter: @lamw
|
||||
===========================================================================
|
||||
.DESCRIPTION
|
||||
This function updates the JSON Persistence property for a given Content Library
|
||||
@@ -245,12 +258,12 @@ Function Set-ContentLibrary {
|
||||
[Parameter(Mandatory=$false)][Switch]$JSONPersistenceDisabled
|
||||
)
|
||||
|
||||
$contentLibaryService = Get-CisService com.vmware.content.library
|
||||
$libaryIDs = $contentLibaryService.list()
|
||||
$contentLibraryService = Get-CisService com.vmware.content.library
|
||||
$LibraryIDs = $contentLibraryService.list()
|
||||
|
||||
$found = $false
|
||||
foreach($libraryID in $libaryIDs) {
|
||||
$library = $contentLibaryService.get($libraryId)
|
||||
foreach($libraryID in $LibraryIDs) {
|
||||
$library = $contentLibraryService.get($libraryId)
|
||||
if($library.name -eq $LibraryName) {
|
||||
$found = $true
|
||||
break
|
||||
@@ -281,10 +294,10 @@ Function New-ExtReplicatedContentLibrary {
|
||||
<#
|
||||
.NOTES
|
||||
===========================================================================
|
||||
Created by: William Lam
|
||||
Organization: VMware
|
||||
Blog: www.virtuallyghetto.com
|
||||
Twitter: @lamw
|
||||
Created by: William Lam
|
||||
Organization: VMware
|
||||
Blog: www.virtuallyghetto.com
|
||||
Twitter: @lamw
|
||||
===========================================================================
|
||||
.DESCRIPTION
|
||||
This function creates a new Subscriber Content Library from a JSON Persisted
|
||||
@@ -331,8 +344,8 @@ Function New-ExtReplicatedContentLibrary {
|
||||
$createSpec = $subscribeLibraryService.Help.create.create_spec.Create()
|
||||
$createSpec.name = $LibraryName
|
||||
$addResults = $createSpec.storage_backings.Add($StorageSpec)
|
||||
$createSpec.subscription_info.automatic_sync_enabled = $false
|
||||
$createSpec.subscription_info.on_demand = $true
|
||||
$createSpec.subscription_info.automatic_sync_enabled = $AutoSync
|
||||
$createSpec.subscription_info.on_demand = $OnDemand
|
||||
$createSpec.subscription_info.subscription_url = $subscribeUrl
|
||||
$createSpec.subscription_info.authentication_method = "NONE"
|
||||
$createSpec.type = "SUBSCRIBED"
|
||||
@@ -345,10 +358,10 @@ Function Remove-SubscribedContentLibrary {
|
||||
<#
|
||||
.NOTES
|
||||
===========================================================================
|
||||
Created by: William Lam
|
||||
Organization: VMware
|
||||
Blog: www.virtuallyghetto.com
|
||||
Twitter: @lamw
|
||||
Created by: William Lam
|
||||
Organization: VMware
|
||||
Blog: www.virtuallyghetto.com
|
||||
Twitter: @lamw
|
||||
===========================================================================
|
||||
.DESCRIPTION
|
||||
This function deletes a Subscriber Content Library
|
||||
@@ -361,12 +374,12 @@ Function Remove-SubscribedContentLibrary {
|
||||
[Parameter(Mandatory=$true)][String]$LibraryName
|
||||
)
|
||||
|
||||
$contentLibaryService = Get-CisService com.vmware.content.library
|
||||
$libaryIDs = $contentLibaryService.list()
|
||||
$contentLibraryService = Get-CisService com.vmware.content.library
|
||||
$LibraryIDs = $contentLibraryService.list()
|
||||
|
||||
$found = $false
|
||||
foreach($libraryID in $libaryIDs) {
|
||||
$library = $contentLibaryService.get($libraryId)
|
||||
foreach($libraryID in $LibraryIDs) {
|
||||
$library = $contentLibraryService.get($libraryId)
|
||||
if($library.name -eq $LibraryName) {
|
||||
$found = $true
|
||||
break
|
||||
@@ -387,10 +400,10 @@ Function New-LocalContentLibrary {
|
||||
<#
|
||||
.NOTES
|
||||
===========================================================================
|
||||
Created by: William Lam
|
||||
Organization: VMware
|
||||
Blog: www.virtuallyghetto.com
|
||||
Twitter: @lamw
|
||||
Created by: William Lam
|
||||
Organization: VMware
|
||||
Blog: www.virtuallyghetto.com
|
||||
Twitter: @lamw
|
||||
===========================================================================
|
||||
.DESCRIPTION
|
||||
This function creates a new Subscriber Content Library from a JSON Persisted
|
||||
@@ -444,10 +457,10 @@ Function Remove-LocalContentLibrary {
|
||||
<#
|
||||
.NOTES
|
||||
===========================================================================
|
||||
Created by: William Lam
|
||||
Organization: VMware
|
||||
Blog: www.virtuallyghetto.com
|
||||
Twitter: @lamw
|
||||
Created by: William Lam
|
||||
Organization: VMware
|
||||
Blog: www.virtuallyghetto.com
|
||||
Twitter: @lamw
|
||||
===========================================================================
|
||||
.DESCRIPTION
|
||||
This function deletes a Local Content Library
|
||||
@@ -460,12 +473,12 @@ Function Remove-LocalContentLibrary {
|
||||
[Parameter(Mandatory=$true)][String]$LibraryName
|
||||
)
|
||||
|
||||
$contentLibaryService = Get-CisService com.vmware.content.library
|
||||
$libaryIDs = $contentLibaryService.list()
|
||||
$contentLibraryService = Get-CisService com.vmware.content.library
|
||||
$LibraryIDs = $contentLibraryService.list()
|
||||
|
||||
$found = $false
|
||||
foreach($libraryID in $libaryIDs) {
|
||||
$library = $contentLibaryService.get($libraryId)
|
||||
foreach($libraryID in $LibraryIDs) {
|
||||
$library = $contentLibraryService.get($libraryId)
|
||||
if($library.name -eq $LibraryName) {
|
||||
$found = $true
|
||||
break
|
||||
@@ -486,56 +499,56 @@ Function Copy-ContentLibrary {
|
||||
<#
|
||||
.NOTES
|
||||
===========================================================================
|
||||
Created by: William Lam
|
||||
Organization: VMware
|
||||
Blog: www.virtuallyghetto.com
|
||||
Twitter: @lamw
|
||||
Created by: William Lam
|
||||
Organization: VMware
|
||||
Blog: www.virtuallyghetto.com
|
||||
Twitter: @lamw
|
||||
===========================================================================
|
||||
.DESCRIPTION
|
||||
This function copies all library items from one Content Library to another
|
||||
.PARAMETER SourceLibaryName
|
||||
.PARAMETER SourceLibraryName
|
||||
The name of the source Content Library to copy from
|
||||
.PARAMETER DestinationLibaryName
|
||||
.PARAMETER DestinationLibraryName
|
||||
The name of the desintation Content Library to copy to
|
||||
.PARAMETER DeleteSourceFile
|
||||
Whther or not to delete library item from the source Content Library after copy
|
||||
.EXAMPLE
|
||||
Copy-ContentLibrary -SourceLibaryName Foo -DestinationLibaryName Bar
|
||||
Copy-ContentLibrary -SourceLibraryName Foo -DestinationLibraryName Bar
|
||||
.EXAMPLE
|
||||
Copy-ContentLibrary -SourceLibaryName Foo -DestinationLibaryName Bar -DeleteSourceFile $true
|
||||
Copy-ContentLibrary -SourceLibraryName Foo -DestinationLibraryName Bar -DeleteSourceFile $true
|
||||
#>
|
||||
param(
|
||||
[Parameter(Mandatory=$true)][String]$SourceLibaryName,
|
||||
[Parameter(Mandatory=$true)][String]$DestinationLibaryName,
|
||||
[Parameter(Mandatory=$true)][String]$SourceLibraryName,
|
||||
[Parameter(Mandatory=$true)][String]$DestinationLibraryName,
|
||||
[Parameter(Mandatory=$false)][Boolean]$DeleteSourceFile=$false
|
||||
)
|
||||
|
||||
$sourceLibraryId = (Get-ContentLibrary -LibraryName $SourceLibaryName).Id
|
||||
$sourceLibraryId = (Get-ContentLibrary -LibraryName $SourceLibraryName).Id
|
||||
if($sourceLibraryId -eq $null) {
|
||||
Write-Host -ForegroundColor red "Unable to find Source Content Library named $SourceLibaryName"
|
||||
Write-Host -ForegroundColor red "Unable to find Source Content Library named $SourceLibraryName"
|
||||
exit
|
||||
}
|
||||
$destinationLibraryId = (Get-ContentLibrary -LibraryName $DestinationLibaryName).Id
|
||||
$destinationLibraryId = (Get-ContentLibrary -LibraryName $DestinationLibraryName).Id
|
||||
if($destinationLibraryId -eq $null) {
|
||||
Write-Host -ForegroundColor Red "Unable to find Destination Content Library named $DestinationLibaryName"
|
||||
Write-Host -ForegroundColor Red "Unable to find Destination Content Library named $DestinationLibraryName"
|
||||
break
|
||||
}
|
||||
|
||||
$sourceItemFiles = Get-ContentLibraryItems -LibraryName $SourceLibaryName
|
||||
$sourceItemFiles = Get-ContentLibraryItems -LibraryName $SourceLibraryName
|
||||
if($sourceItemFiles -eq $null) {
|
||||
Write-Host -ForegroundColor red "Unable to retrieve Content Library Items from $SourceLibaryName"
|
||||
Write-Host -ForegroundColor red "Unable to retrieve Content Library Items from $SourceLibraryName"
|
||||
break
|
||||
}
|
||||
|
||||
$contentLibaryItemService = Get-CisService com.vmware.content.library.item
|
||||
$contentLibraryItemService = Get-CisService com.vmware.content.library.item
|
||||
|
||||
foreach ($sourceItemFile in $sourceItemFiles) {
|
||||
# Check to see if file already exists in destination Content Library
|
||||
$result = Get-ContentLibraryItems -LibraryName $DestinationLibaryName -LibraryItemName $sourceItemFile.Name
|
||||
$result = Get-ContentLibraryItems -LibraryName $DestinationLibraryName -LibraryItemName $sourceItemFile.Name
|
||||
|
||||
if($result -eq $null) {
|
||||
# Create CopySpec
|
||||
$copySpec = $contentLibaryItemService.Help.copy.destination_create_spec.Create()
|
||||
$copySpec = $contentLibraryItemService.Help.copy.destination_create_spec.Create()
|
||||
$copySpec.library_id = $destinationLibraryId
|
||||
$copySpec.name = $sourceItemFile.Name
|
||||
$copySpec.description = $sourceItemFile.Description
|
||||
@@ -545,7 +558,7 @@ Function Copy-ContentLibrary {
|
||||
# Perform Copy
|
||||
try {
|
||||
Write-Host -ForegroundColor Cyan "Copying" $sourceItemFile.Name "..."
|
||||
$copyResult = $contentLibaryItemService.copy($UniqueChangeId, $sourceItemFile.Id, $copySpec)
|
||||
$copyResult = $contentLibraryItemService.copy($UniqueChangeId, $sourceItemFile.Id, $copySpec)
|
||||
} catch {
|
||||
Write-Host -ForegroundColor Red "Failed to copy" $sourceItemFile.Name
|
||||
$Error[0]
|
||||
@@ -556,7 +569,7 @@ Function Copy-ContentLibrary {
|
||||
if($DeleteSourceFile) {
|
||||
try {
|
||||
Write-Host -ForegroundColor Magenta "Deleteing" $sourceItemFile.Name "..."
|
||||
$deleteResult = $contentLibaryItemService.delete($sourceItemFile.Id)
|
||||
$deleteResult = $contentLibraryItemService.delete($sourceItemFile.Id)
|
||||
} catch {
|
||||
Write-Host -ForegroundColor Red "Failed to delete" $sourceItemFile.Name
|
||||
$Error[0]
|
||||
@@ -570,7 +583,7 @@ Function Copy-ContentLibrary {
|
||||
if($DeleteSourceFile) {
|
||||
try {
|
||||
Write-Host -ForegroundColor Magenta "Deleteing" $sourceItemFile.Name "..."
|
||||
$deleteResult = $contentLibaryItemService.delete($sourceItemFile.Id)
|
||||
$deleteResult = $contentLibraryItemService.delete($sourceItemFile.Id)
|
||||
} catch {
|
||||
Write-Host -ForegroundColor Red "Failed to delete" $sourceItemFile.Name
|
||||
break
|
||||
@@ -578,4 +591,190 @@ Function Copy-ContentLibrary {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Function New-VMTX {
|
||||
<#
|
||||
.NOTES
|
||||
===========================================================================
|
||||
Created by: William Lam
|
||||
Organization: VMware
|
||||
Blog: www.virtuallyghetto.com
|
||||
Twitter: @lamw
|
||||
===========================================================================
|
||||
.DESCRIPTION
|
||||
This function clones a VM to VM Template in Content Library (currently only supported on VMC)
|
||||
.PARAMETER SourceVMName
|
||||
The name of the source VM to clone
|
||||
.PARAMETER VMTXName
|
||||
The name of the VM Template in Content Library
|
||||
.PARAMETER Description
|
||||
Description of the VM template
|
||||
.PARAMETER LibraryName
|
||||
The name of the Content Library to clone to
|
||||
.PARAMETER FolderName
|
||||
The name of vSphere Folder (Defaults to Workloads for VMC)
|
||||
.PARAMETER ResourcePoolName
|
||||
The name of the vSphere Resource Pool (Defaults to Compute-ResourcePools for VMC)
|
||||
.EXAMPLE
|
||||
New-VMTX -SourceVMName "Windows10-BaseInstall" -VMTXName "Windows10-VMTX-Template" -LibraryName "VMC-CL-01"
|
||||
#>
|
||||
param(
|
||||
[Parameter(Mandatory=$true)][String]$SourceVMName,
|
||||
[Parameter(Mandatory=$true)][String]$VMTXName,
|
||||
[Parameter(Mandatory=$false)][String]$Description,
|
||||
[Parameter(Mandatory=$true)][String]$LibraryName,
|
||||
[Parameter(Mandatory=$false)][String]$FolderName="Workloads",
|
||||
[Parameter(Mandatory=$false)][String]$ResourcePoolName="Compute-ResourcePool"
|
||||
)
|
||||
|
||||
$vmtxService = Get-CisService -Name "com.vmware.vcenter.vm_template.library_items"
|
||||
|
||||
$sourceVMId = ((Get-VM -Name $SourceVMName).ExtensionData.MoRef).Value
|
||||
$libraryId = ((Get-ContentLibrary -LibraryName $LibraryName).Id).Value
|
||||
$folderId = ((Get-Folder -Name $FolderName).ExtensionData.MoRef).Value
|
||||
$rpId = ((Get-ResourcePool -Name $ResourcePoolName).ExtensionData.MoRef).Value
|
||||
|
||||
$vmtxCreateSpec = $vmtxService.Help.create.spec.Create()
|
||||
$vmtxCreateSpec.source_vm = $sourceVMId
|
||||
$vmtxCreateSpec.name = $VMTXName
|
||||
$vmtxCreateSpec.description = $Description
|
||||
$vmtxCreateSpec.library = $libraryId
|
||||
$vmtxCreateSpec.placement.folder = $folderId
|
||||
$vmtxCreateSpec.placement.resource_pool = $rpId
|
||||
|
||||
Write-Host "`nCreating new VMTX Template from $SourceVMName in Content Library $LibraryName ..."
|
||||
$result = $vmtxService.create($vmtxCreateSpec)
|
||||
}
|
||||
|
||||
Function New-VMFromVMTX {
|
||||
<#
|
||||
.NOTES
|
||||
===========================================================================
|
||||
Created by: William Lam
|
||||
Organization: VMware
|
||||
Blog: www.virtuallyghetto.com
|
||||
Twitter: @lamw
|
||||
===========================================================================
|
||||
.DESCRIPTION
|
||||
This function deploys a new VM from Template in Content Library (currently only supported in VMC)
|
||||
.PARAMETER VMTXName
|
||||
The name of the VM Template in Content Library to deploy from
|
||||
.PARAMETER NewVMName
|
||||
The name of the new VM to deploy
|
||||
.PARAMETER FolderName
|
||||
The name of vSphere Folder (Defaults to Workloads for VMC)
|
||||
.PARAMETER ResourcePoolName
|
||||
The name of the vSphere Resource Pool (Defaults to Compute-ResourcePools for VMC)
|
||||
.PARAMETER NumCpu
|
||||
The number of vCPU to configure for the new VM
|
||||
.PARAMETER MemoryMb
|
||||
The amount of memory (MB) to configure for the new VM
|
||||
.PARAMETER PowerOn
|
||||
To power on the VM after deploy
|
||||
.EXAMPLE
|
||||
New-VMFromVMTX -NewVMName "FooFoo" -VMTXName "FooBar" -PowerOn $true -NumCpu 4 -MemoryMB 2048
|
||||
#>
|
||||
param(
|
||||
[Parameter(Mandatory=$true)][String]$VMTXName,
|
||||
[Parameter(Mandatory=$true)][String]$NewVMName,
|
||||
[Parameter(Mandatory=$false)][String]$FolderName="Workloads",
|
||||
[Parameter(Mandatory=$false)][String]$ResourcePoolName="Compute-ResourcePool",
|
||||
[Parameter(Mandatory=$false)][String]$DatastoreName="WorkloadDatastore",
|
||||
[Parameter(Mandatory=$false)][Int]$NumCpu,
|
||||
[Parameter(Mandatory=$false)][Int]$MemoryMB,
|
||||
[Parameter(Mandatory=$false)][Boolean]$PowerOn=$false
|
||||
)
|
||||
|
||||
$vmtxService = Get-CisService -Name "com.vmware.vcenter.vm_template.library_items"
|
||||
$vmtxId = (Get-ContentLibraryItem -Name $VMTXName).Id
|
||||
$folderId = ((Get-Folder -Name $FolderName).ExtensionData.MoRef).Value
|
||||
$rpId = ((Get-ResourcePool -Name $ResourcePoolName).ExtensionData.MoRef).Value
|
||||
$datastoreId = ((Get-Datastore -Name $DatastoreName).ExtensionData.MoRef).Value
|
||||
|
||||
$vmtxDeploySpec = $vmtxService.Help.deploy.spec.Create()
|
||||
$vmtxDeploySpec.name = $NewVMName
|
||||
$vmtxDeploySpec.powered_on = $PowerOn
|
||||
$vmtxDeploySpec.placement.folder = $folderId
|
||||
$vmtxDeploySpec.placement.resource_pool = $rpId
|
||||
$vmtxDeploySpec.vm_home_storage.datastore = $datastoreId
|
||||
$vmtxDeploySpec.disk_storage.datastore = $datastoreId
|
||||
|
||||
if($NumCpu) {
|
||||
$vmtxDeploySpec.hardware_customization.cpu_update.num_cpus = $NumCpu
|
||||
}
|
||||
if($MemoryMB) {
|
||||
$vmtxDeploySpec.hardware_customization.memory_update.memory = $MemoryMB
|
||||
}
|
||||
|
||||
Write-Host "`nDeploying new VM $NewVMName from VMTX Template $VMTXName ..."
|
||||
$results = $vmtxService.deploy($vmtxId,$vmtxDeploySpec)
|
||||
}
|
||||
|
||||
Function New-SubscribedContentLibrary {
|
||||
<#
|
||||
.NOTES
|
||||
===========================================================================
|
||||
Created by: William Lam
|
||||
Organization: VMware
|
||||
Blog: www.virtuallyghetto.com
|
||||
Twitter: @lamw
|
||||
===========================================================================
|
||||
.DESCRIPTION
|
||||
This function creates a new Subscriber Content Library from Subscription URL
|
||||
.PARAMETER LibraryName
|
||||
The name of the new vSphere Content Library
|
||||
.PARAMETER DatastoreName
|
||||
The name of the vSphere Datastore to store the Content Library
|
||||
.PARAMETER SubscriptionURL
|
||||
The URL of the published Content Library
|
||||
.PARAMETER SubscriptionThumbprint
|
||||
The SSL Thumbprint for the published Content Library
|
||||
.PARAMETER OnDemand
|
||||
Specifies whether content is downloaded on-demand (e.g. no immediately)
|
||||
.PARAMETER AutomaticSync
|
||||
Specifies whether automatic synchronization with the external content library is enabled
|
||||
.EXAMPLE
|
||||
New-SubscribedContentLibrary -LibraryName NestedESXi -DatastoreName vsanDatastore -SubscriptionURL https://download3.vmware.com/software/vmw-tools/lib.json -SubscriptionThumbprint "7a:c4:08:2d:d3:55:56:af:9f:26:43:65:d0:31:99:0b:d2:f3:d8:69" -AutomaticSync
|
||||
.EXAMPLE
|
||||
New-SubscribedContentLibrary -LibraryName NestedESXi -DatastoreName vsanDatastore -SubscriptionURL https://download3.vmware.com/software/vmw-tools/lib.json -SubscriptionThumbprint "7a:c4:08:2d:d3:55:56:af:9f:26:43:65:d0:31:99:0b:d2:f3:d8:69" -OnDemand
|
||||
#>
|
||||
param(
|
||||
[Parameter(Mandatory=$true)][String]$LibraryName,
|
||||
[Parameter(Mandatory=$true)][String]$DatastoreName,
|
||||
[Parameter(Mandatory=$true)][String]$SubscriptionURL,
|
||||
[Parameter(Mandatory=$true)][String]$SubscriptionThumbprint,
|
||||
[Parameter(Mandatory=$false)][Switch]$OnDemand,
|
||||
[Parameter(Mandatory=$false)][Switch]$AutomaticSync
|
||||
)
|
||||
|
||||
$datastore = Get-Datastore -Name $DatastoreName
|
||||
|
||||
if($datastore) {
|
||||
$datastoreId = $datastore.ExtensionData.MoRef.Value
|
||||
$subscribeLibraryService = Get-CisService -Name "com.vmware.content.subscribed_library"
|
||||
|
||||
$StorageSpec = [pscustomobject] @{
|
||||
datastore_id = $datastoreId;
|
||||
type = "DATASTORE";
|
||||
}
|
||||
|
||||
$UniqueChangeId = [guid]::NewGuid().tostring()
|
||||
|
||||
$createSpec = $subscribeLibraryService.help.create.create_spec.create()
|
||||
$createSpec.name = $LibraryName
|
||||
$createSpec.type = "SUBSCRIBED"
|
||||
$addResults = $createSpec.storage_backings.Add($StorageSpec)
|
||||
|
||||
if($OnDemand) { $OnDemandFlag = $true } else { $OnDemandFlag = $false }
|
||||
if($AutomaticSync) { $AutomaticSyncFlag = $true } else { $AutomaticSyncFlag = $false }
|
||||
$createSpec.subscription_info.on_demand = $OnDemandFlag
|
||||
$createSpec.subscription_info.automatic_sync_enabled = $AutomaticSyncFlag
|
||||
$createSpec.subscription_info.subscription_url = $SubscriptionURL
|
||||
$createSpec.subscription_info.authentication_method = "NONE"
|
||||
$createSpec.subscription_info.ssl_thumbprint = $SubscriptionThumbprint
|
||||
|
||||
Write-Host "Creating new Subscribed Content Library called $LibraryName ..."
|
||||
$library = $subscribeLibraryService.create($UniqueChangeId, $createSpec)
|
||||
}
|
||||
}
|
||||
311
Modules/CrossvCentervmotion/XVM.psm1
Normal file
311
Modules/CrossvCentervmotion/XVM.psm1
Normal file
@@ -0,0 +1,311 @@
|
||||
Function Get-XVCMStatus {
|
||||
<#
|
||||
.NOTES
|
||||
===========================================================================
|
||||
Created by: William Lam
|
||||
Organization: VMware
|
||||
Blog: www.virtuallyghetto.com
|
||||
Twitter: @lamw
|
||||
===========================================================================
|
||||
.DESCRIPTION
|
||||
This function returns whether Cross vCenter Workload Migration Utility is running or not
|
||||
.EXAMPLE
|
||||
Get-XVCMStatus
|
||||
#>
|
||||
$Uri = "http://localhost:8080/api/status" #Updated for 2.0, Old: "http://localhost:8080/api/ping"
|
||||
|
||||
$results = Invoke-WebRequest -Uri $Uri -Method GET -TimeoutSec 5
|
||||
|
||||
if($results.StatusCode -eq 200) {
|
||||
Write-Host -ForegroundColor Green $results.Content
|
||||
} else { Write-Host -ForegroundColor Red "Cross vCenter Workload Migration Utility is probably not running" }
|
||||
}
|
||||
|
||||
Function Get-XVCMSite {
|
||||
<#
|
||||
.NOTES
|
||||
===========================================================================
|
||||
Created by: William Lam
|
||||
Organization: VMware
|
||||
Blog: www.virtuallyghetto.com
|
||||
Twitter: @lamw
|
||||
===========================================================================
|
||||
.DESCRIPTION
|
||||
This function returns all registered vCenter Servers
|
||||
.EXAMPLE
|
||||
Get-XVCMSite
|
||||
#>
|
||||
$Uri = "http://localhost:8080/api/sites"
|
||||
|
||||
$results = Invoke-WebRequest -Uri $Uri -Method GET
|
||||
|
||||
if($results.StatusCode -eq 200) {
|
||||
($results.Content | ConvertFrom-Json)|select sitename,hostname,username
|
||||
} else { Write-Host -ForegroundColor Red "Failed to retrieve VC Site Registration details" }
|
||||
}
|
||||
|
||||
Function New-XVCMSite {
|
||||
<#
|
||||
.NOTES
|
||||
===========================================================================
|
||||
Created by: William Lam
|
||||
Organization: VMware
|
||||
Blog: www.virtuallyghetto.com
|
||||
Twitter: @lamw
|
||||
===========================================================================
|
||||
.DESCRIPTION
|
||||
This function registers a new vCenter Server endpoint
|
||||
.PARAMETER SiteName
|
||||
The display name for the particular vCenter Server to be registered
|
||||
.PARAMETER VCHostname
|
||||
The Hostname/IP Address of vCenter Server
|
||||
.PARAMETER VCUsername
|
||||
The VC Username of vCenter Server
|
||||
.PARAMETER VCPassword
|
||||
The VC Password of vCenter Server
|
||||
.PARAMETER Insecure
|
||||
Flag to disable SSL Verification checking, useful for lab environments
|
||||
.EXAMPLE
|
||||
New-XVCMSite -SiteName "SiteA" -VCHostname "vcenter65-1.primp-industries.com" -VCUsername "administrator@vsphere.local" -VCPassword "VMware1!" -Insecure
|
||||
#>
|
||||
param(
|
||||
[Parameter(Mandatory=$true)][String]$SiteName,
|
||||
[Parameter(Mandatory=$true)][String]$VCHostname,
|
||||
[Parameter(Mandatory=$true)][String]$VCUsername,
|
||||
[Parameter(Mandatory=$true)][String]$VCPassword,
|
||||
[Parameter(Mandatory=$false)][Switch]$Insecure
|
||||
)
|
||||
|
||||
$Uri = "http://localhost:8080/api/sites"
|
||||
|
||||
$insecureFlag = $false
|
||||
if($Insecure) {
|
||||
$insecureFlag = $true
|
||||
}
|
||||
|
||||
$body = @{
|
||||
"sitename"=$SiteName;
|
||||
"hostname"=$VCHostname;
|
||||
"username"=$VCUsername;
|
||||
"password"=$VCPassword;
|
||||
"insecure"=$insecureFlag;
|
||||
}
|
||||
|
||||
$body = $body | ConvertTo-Json
|
||||
|
||||
Write-Host -ForegroundColor Cyan "Registering vCenter Server $VCHostname as $SiteName ..."
|
||||
$results = Invoke-WebRequest -Uri $Uri -Method POST -Body $body -ContentType "application/json"
|
||||
|
||||
if($results.StatusCode -eq 200) {
|
||||
Write-Host -ForegroundColor Green "Successfully registered $SiteName"
|
||||
} else { Write-Host -ForegroundColor Red "Failed to register $SiteName" }
|
||||
}
|
||||
|
||||
Function Remove-XVCMSite {
|
||||
<#
|
||||
.NOTES
|
||||
===========================================================================
|
||||
Created by: William Lam
|
||||
Organization: VMware
|
||||
Blog: www.virtuallyghetto.com
|
||||
Twitter: @lamw
|
||||
===========================================================================
|
||||
.DESCRIPTION
|
||||
This function removes vCenter Server endpoint
|
||||
.PARAMETER SiteName
|
||||
The name of the registered vCenter Server to remove
|
||||
.EXAMPLE
|
||||
Remove-XVCMSite -SiteName "SiteA"
|
||||
#>
|
||||
param(
|
||||
[Parameter(Mandatory=$true)][String]$SiteName
|
||||
)
|
||||
|
||||
$Uri = "http://localhost:8080/api/sites/$SiteName"
|
||||
|
||||
Write-Host -ForegroundColor Cyan "Deleting vCenter Server Site Registerion $SiteName ..."
|
||||
$results = Invoke-WebRequest -Uri $Uri -Method DELETE
|
||||
|
||||
if($results.StatusCode -eq 200) {
|
||||
Write-Host -ForegroundColor Green "Successfully deleted $SiteName"
|
||||
} else { Write-Host -ForegroundColor Red "Failed to deleted $SiteName" }
|
||||
}
|
||||
|
||||
Function New-XVCMRequest {
|
||||
<#
|
||||
.NOTES
|
||||
===========================================================================
|
||||
Created by: William Lam
|
||||
Organization: VMware
|
||||
Blog: www.virtuallyghetto.com
|
||||
Twitter: @lamw
|
||||
===========================================================================
|
||||
.DESCRIPTION
|
||||
This function initiates a migration request
|
||||
.PARAMETER opType
|
||||
The type of task, Relocate or Clone
|
||||
.PARAMETER SrcSite
|
||||
The name of the source vCenter Server
|
||||
.PARAMETER DstSite
|
||||
The name of the destination vCenter Server
|
||||
.PARAMETER SrcDatacenter
|
||||
The name of the source vSphere Datacenter
|
||||
.PARAMETER DstDatacenter
|
||||
The name of the destination vSphere Datacenter
|
||||
.PARAMETER DstCluster
|
||||
The name of the destination vSphere Cluster, set to null if DstHost is defined
|
||||
.PARAMETER DstPool
|
||||
The name of the destination vSphere Resource Pool
|
||||
.PARAMETER DstFolder
|
||||
The name of the destination vSphere Folder
|
||||
.PARAMETER DstDatastore
|
||||
The name of the destination Datastore
|
||||
.PARAMETER DstHost
|
||||
The name of the destination host. Set to null if DstCluster is defined
|
||||
.PARAMETER srcVMs
|
||||
List of VMs to migrate
|
||||
.PARAMETER NetworkMapping
|
||||
Hash table of the VM network mappings between your source and destination vCenter Server
|
||||
.EXAMPLE
|
||||
New-XVCMRequest -opType Relocate -SrcSite SiteA -DstSite SiteB `
|
||||
-SrcDatacenter Datacenter-SiteA -DstDatacenter Datacenter-SiteB `
|
||||
-DstCluster $null -DstHost VMhost1.test.lab `
|
||||
-DstDatastore vsanDatastore `
|
||||
-srcVMs @("PhotonOS-01","PhotonOS-02","PhotonOS-03","PhotonOS-04") `
|
||||
-NetworkMapping @{"DVPG-VM Network 1"="DVPG-Internal Network";"DVPG-VM Network 2"="DVPG-External Network"}
|
||||
.EXAMPLE
|
||||
New-XVCMRequest -opType Clone -SrcSite OREGON -DstSite CALIF `
|
||||
-SrcDatacenter SDDC-Datacenter -srcVMs @(“DUDE-ubuntu”) `
|
||||
-DstDatacenter SDDC-Datacenter `
|
||||
-DstCluster "Cluster-1" -DstHost $null `
|
||||
-DstPool Compute-ResourcePool `
|
||||
-DstFolder Workloads `
|
||||
-DstDatastore WorkloadDatastore `
|
||||
-NetworkMapping @{"OREGON-VMs-sddc"="CALIF-sddc-VMs"}
|
||||
#>
|
||||
param(
|
||||
[Parameter(Mandatory=$true)][String]$opType, #Added by CPM for 2.0
|
||||
[Parameter(Mandatory=$true)][String]$SrcSite,
|
||||
[Parameter(Mandatory=$true)][String]$DstSite,
|
||||
[Parameter(Mandatory=$true)][String]$SrcDatacenter,
|
||||
[Parameter(Mandatory=$true)][String]$DstDatacenter,
|
||||
[Parameter(Mandatory=$true)][AllowNull()] $DstCluster, #Added [AllowNull()], removed [String] by CPM for 2.0
|
||||
[Parameter(Mandatory=$true)][String]$DstPool,
|
||||
[Parameter(Mandatory=$true)][String]$DstFolder,
|
||||
[Parameter(Mandatory=$true)][String]$DstDatastore,
|
||||
[Parameter(Mandatory=$true)][AllowNull()] $DstHost, #Added by CPM for 2.0
|
||||
[Parameter(Mandatory=$true)][String[]]$srcVMs,
|
||||
[Parameter(Mandatory=$true)][Hashtable]$NetworkMapping
|
||||
)
|
||||
|
||||
$Uri = "http://localhost:8080/api/tasks"
|
||||
|
||||
$body = @{
|
||||
"sourceSite"=$SrcSite;
|
||||
"targetSite"=$DstSite;
|
||||
"sourceDatacenter"=$SrcDatacenter;
|
||||
"targetDatacenter"=$dstDatacenter;
|
||||
"targetPool"=$DstPool;
|
||||
"targetFolder"=$DstFolder;
|
||||
"targetCluster"=$DstCluster;
|
||||
"targetDatastore"=$DstDatastore;
|
||||
"targetHost"=$DstHost; #Added by CPM for 2.0
|
||||
"networkMap"=$NetworkMapping;
|
||||
"vmList"=$srcVMs;
|
||||
"operationType"=$opType; #Added by CPM for 2.0
|
||||
}
|
||||
|
||||
$body = $body | ConvertTo-Json
|
||||
|
||||
Write-Host -ForegroundColor Cyan "Initiating migration request ..."
|
||||
$results = Invoke-WebRequest -Uri $Uri -Method POST -Body $body -ContentType "application/json"
|
||||
|
||||
if($results.StatusCode -eq 200) {
|
||||
$taskId = ($results.Content | ConvertFrom-Json).requestId
|
||||
Write-Host -ForegroundColor Green "Successfully issued migration with TaskID: $taskId"
|
||||
} else { Write-Host -ForegroundColor Red "Failed to initiate migration request" }
|
||||
}
|
||||
|
||||
Function Get-XVCMTask {
|
||||
<#
|
||||
.NOTES
|
||||
===========================================================================
|
||||
Created by: William Lam
|
||||
Organization: VMware
|
||||
Blog: www.virtuallyghetto.com
|
||||
Twitter: @lamw
|
||||
===========================================================================
|
||||
.DESCRIPTION
|
||||
This function retrieves either all migration tasks and/or a specific migration task
|
||||
.PARAMETER Id
|
||||
The task ID returned from initiating a migration
|
||||
.EXAMPLE
|
||||
Get-XVCMTask -Id <Task ID>
|
||||
#>
|
||||
param(
|
||||
[Parameter(Mandatory=$false)][String]$Id
|
||||
)
|
||||
|
||||
$Uri = "http://localhost:8080/api/tasks"
|
||||
|
||||
if($Id) {
|
||||
$body = @{"requestId"=$Id}
|
||||
|
||||
$results = Invoke-WebRequest -Uri $Uri -Method GET -Body $body -ContentType "application/json"
|
||||
} else {
|
||||
$results = Invoke-WebRequest -Uri $Uri -Method GET
|
||||
}
|
||||
|
||||
if($results.StatusCode -eq 200) {
|
||||
$results.Content | ConvertFrom-Json
|
||||
} else { Write-Host -ForegroundColor Red "Failed to retrieve tasks" }
|
||||
}
|
||||
|
||||
Function Get-VMNetwork {
|
||||
<#
|
||||
.NOTES
|
||||
===========================================================================
|
||||
Created by: William Lam
|
||||
Organization: VMware
|
||||
Blog: www.virtuallyghetto.com
|
||||
Twitter: @lamw
|
||||
===========================================================================
|
||||
.DESCRIPTION
|
||||
This function returns the list of all VM Networks attached to
|
||||
given VMs to help with initiating migration
|
||||
.PARAMETER srcVMs
|
||||
List of VMs to query their current VM Networks
|
||||
.EXAMPLE
|
||||
Get-VMNetwork -srcVMs @("PhotonOS-01","PhotonOS-02","PhotonOS-03","PhotonOS-04")
|
||||
#>
|
||||
param(
|
||||
[Parameter(Mandatory=$false)][String[]]$srcVMs
|
||||
)
|
||||
|
||||
if (-not $global:DefaultVIServers) { Write-Host -ForegroundColor red "No vCenter Server Connection found, please connect to your source vCenter Server using Connect-VIServer"; break }
|
||||
|
||||
$results = @()
|
||||
if($srcVMs) {
|
||||
foreach ($srcVM in $srcVMs) {
|
||||
$vm = Get-VM -Name $srcVM
|
||||
$networkDetails = $vm | Get-NetworkAdapter
|
||||
$tmp = [pscustomobject] @{
|
||||
Name = $srcVM;
|
||||
Adapter = $networkDetails.name;
|
||||
Network = $networkDetails.NetworkName;
|
||||
}
|
||||
$results+=$tmp
|
||||
}
|
||||
} else {
|
||||
foreach ($vm in Get-VM) {
|
||||
$networkDetails = $vm | Get-NetworkAdapter
|
||||
$tmp = [pscustomobject] @{
|
||||
Name = $vm.Name;
|
||||
Adapter = $networkDetails.name;
|
||||
Network = $networkDetails.NetworkName;
|
||||
}
|
||||
$results+=$tmp
|
||||
}
|
||||
}
|
||||
$results
|
||||
}
|
||||
98
Modules/InstantClone/InstantClone.psm1
Normal file
98
Modules/InstantClone/InstantClone.psm1
Normal file
@@ -0,0 +1,98 @@
|
||||
Function New-InstantClone {
|
||||
<#
|
||||
.NOTES
|
||||
===========================================================================
|
||||
Created by: William Lam
|
||||
Date: Apr 29, 2018
|
||||
Organization: VMware
|
||||
Blog: www.virtuallyghetto.com
|
||||
Twitter: @lamw
|
||||
===========================================================================
|
||||
.SYNOPSIS
|
||||
This function demonstrates the use of the new "Parentless" Instant Clone
|
||||
API that was introduced in vSphere 6.7
|
||||
.DESCRIPTION
|
||||
Function to create new "Parentless" Instant Clones in vSphere 6.7
|
||||
.EXAMPLE
|
||||
$SourceVM = "Foo"
|
||||
$newVMName = Foo-IC-1
|
||||
$guestCustomizationValues = @{
|
||||
"guestinfo.ic.hostname" = $newVMName
|
||||
"guestinfo.ic.ipaddress" = "192.168.30.10"
|
||||
"guestinfo.ic.netmask" = "255.255.255.0"
|
||||
"guestinfo.ic.gateway" = "192.168.30.1"
|
||||
"guestinfo.ic.dns" = "192.168.30.1"
|
||||
}
|
||||
New-InstantClone -SourceVM $SourceVM -DestinationVM $newVMName -CustomizationFields $guestCustomizationValues
|
||||
.NOTES
|
||||
Make sure that you have both a vSphere 6.7 env (VC/ESXi) as well as
|
||||
as the latest PowerCLI 10.1 installed which is reuqired to use vSphere 6.7 APIs
|
||||
#>
|
||||
param(
|
||||
[Parameter(Mandatory=$true)][String]$SourceVM,
|
||||
[Parameter(Mandatory=$true)][String]$DestinationVM,
|
||||
[Parameter(Mandatory=$true)][Hashtable]$CustomizationFields
|
||||
)
|
||||
$vm = Get-VM -Name $SourceVM
|
||||
|
||||
$config = @()
|
||||
$CustomizationFields.GetEnumerator() | Foreach-Object {
|
||||
$optionValue = New-Object VMware.Vim.OptionValue
|
||||
$optionValue.Key = $_.Key
|
||||
$optionValue.Value = $_.Value
|
||||
$config += $optionValue
|
||||
}
|
||||
|
||||
# SourceVM must either be running or running but in Frozen State
|
||||
if($vm.PowerState -ne "poweredOn") {
|
||||
Write-Host -ForegroundColor Red "Instant Cloning is only supported on a PoweredOn or Frozen VM"
|
||||
break
|
||||
}
|
||||
|
||||
# SourceVM == Powered On
|
||||
if((Get-VM $SourceVM).ExtensionData.Runtime.InstantCloneFrozen -eq $false) {
|
||||
|
||||
# Retrieve all Network Adapters for SourceVM
|
||||
$vmNetworkAdapters = @()
|
||||
$devices = $vm.ExtensionData.Config.Hardware.Device
|
||||
foreach ($device in $devices) {
|
||||
if($device -is [VMware.Vim.VirtualEthernetCard]) {
|
||||
$vmNetworkAdapters += $device
|
||||
}
|
||||
}
|
||||
|
||||
$spec = New-Object VMware.Vim.VirtualMachineInstantCloneSpec
|
||||
$locationSpec = New-Object VMware.Vim.VirtualMachineRelocateSpec
|
||||
|
||||
# Disconect all NICs for new Instant Clone to ensure no dupe addresses on network
|
||||
# post-Instant Clone workflow needs to renable after uypdating GuestOS
|
||||
foreach ($vmNetworkAdapter in $vmNetworkAdapters) {
|
||||
$networkName = $vmNetworkAdapter.backing.deviceName
|
||||
$deviceConfigSpec = New-Object VMware.Vim.VirtualDeviceConfigSpec
|
||||
$deviceConfigSpec.Operation = "edit"
|
||||
$deviceConfigSpec.Device = $vmNetworkAdapter
|
||||
$deviceConfigSpec.Device.backing = New-Object VMware.Vim.VirtualEthernetCardNetworkBackingInfo
|
||||
$deviceConfigSpec.device.backing.deviceName = $networkName
|
||||
$connectable = New-Object VMware.Vim.VirtualDeviceConnectInfo
|
||||
$connectable.MigrateConnect = "disconnect"
|
||||
$deviceConfigSpec.Device.Connectable = $connectable
|
||||
$locationSpec.DeviceChange += $deviceConfigSpec
|
||||
}
|
||||
|
||||
$spec.Config = $config
|
||||
$spec.Location = $locationSpec
|
||||
$spec.Name = $DestinationVM
|
||||
# SourceVM == Frozen
|
||||
} else {
|
||||
$spec = New-Object VMware.Vim.VirtualMachineInstantCloneSpec
|
||||
$locationSpec = New-Object VMware.Vim.VirtualMachineRelocateSpec
|
||||
$spec.Config = $config
|
||||
$spec.Location = $locationSpec
|
||||
$spec.Name = $DestinationVM
|
||||
}
|
||||
|
||||
Write-Host "Creating Instant Clone $DestinationVM ..."
|
||||
$task = $vm.ExtensionData.InstantClone_Task($spec)
|
||||
$task1 = Get-Task -Id ("Task-$($task.value)")
|
||||
$task1 | Wait-Task | Out-Null
|
||||
}
|
||||
@@ -7,7 +7,35 @@
|
||||
Copyright = '(c) 2017. All rights reserved.'
|
||||
Description = 'Powershell Module for NSX-T REST API Functions'
|
||||
PowerShellVersion = '5.0'
|
||||
FunctionsToExport = 'Get-NSXTComputeManager','Get-NSXTFabricNode','Get-NSXTFirewallRule','Get-NSXTIPPool','Get-NSXTLogicalSwitch','Get-NSXTManager','Get-NSXTTransportZone','Get-NSXTController'
|
||||
FunctionsToExport = 'Get-NSXTBGPNeighbors',
|
||||
'Get-NSXTComputeManager',
|
||||
'Get-NSXTController',
|
||||
'Get-NSXTEdgeCluster',
|
||||
'Get-NSXTFabricNode',
|
||||
'Get-NSXTFabricVM',
|
||||
'Get-NSXTFirewallRule',
|
||||
'Get-NSXTForwardingTable',
|
||||
'Get-NSXTIPPool',
|
||||
'Get-NSXTLogicalRouter',
|
||||
'Get-NSXTLogicalRouterPorts',
|
||||
'Get-NSXTLogicalSwitch',
|
||||
'Get-NSXTManager',
|
||||
'Get-NSXTNetworkRoutes',
|
||||
'Get-NSXTRoutingTable',
|
||||
'Get-NSXTTraceFlow',
|
||||
'Get-NSXTTraceFlowObservations',
|
||||
'Get-NSXTTransportNode',
|
||||
'Get-NSXTTransportZone',
|
||||
'Get-NSXTClusterNode',
|
||||
'Set-NSXTIPPool',
|
||||
'Set-NSXTLogicalRouter',
|
||||
'Set-NSXTLogicalSwitch',
|
||||
'Set-NSXTTraceFlow',
|
||||
'Get-NSXTIPAMIPBlock',
|
||||
'Set-NSXTIPAMIPBlock',
|
||||
'Remove-NSXTIPAMIPBlock'
|
||||
|
||||
|
||||
PrivateData = @{
|
||||
PSData = @{
|
||||
Tags = @('NSX-T','REST')
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
192
Modules/PerVMEVC/PerVMEVC.psm1
Normal file
192
Modules/PerVMEVC/PerVMEVC.psm1
Normal file
@@ -0,0 +1,192 @@
|
||||
function Get-VMEvcMode {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Gathers information on the EVC status of a VM
|
||||
.DESCRIPTION
|
||||
Will provide the EVC status for the specified VM
|
||||
.NOTES
|
||||
Author: Kyle Ruddy, @kmruddy, thatcouldbeaproblem.com
|
||||
.PARAMETER Name
|
||||
VM name which the function should be ran against
|
||||
.EXAMPLE
|
||||
Get-VMEvcMode -Name vmName
|
||||
Retreives the EVC status of the provided VM
|
||||
#>
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[Parameter(Mandatory=$true,Position=0,ValueFromPipelineByPropertyName=$true)]
|
||||
$Name
|
||||
)
|
||||
|
||||
Process {
|
||||
$evVM = @()
|
||||
|
||||
if ($name -is [string]) {$evVM += Get-VM -Name $Name -ErrorAction SilentlyContinue}
|
||||
elseif ($name -is [array]) {
|
||||
|
||||
if ($name[0] -is [string]) {
|
||||
$name | foreach {
|
||||
$evVM += Get-VM -Name $_ -ErrorAction SilentlyContinue
|
||||
}
|
||||
}
|
||||
elseif ($name[0] -is [VMware.VimAutomation.ViCore.Impl.V1.Inventory.InventoryItemImpl]) {$evVM = $name}
|
||||
|
||||
}
|
||||
elseif ($name -is [VMware.VimAutomation.ViCore.Impl.V1.Inventory.InventoryItemImpl]) {$evVM += $name}
|
||||
|
||||
if ($evVM -eq $null) {Write-Warning "No VMs found."}
|
||||
else {
|
||||
$output = @()
|
||||
foreach ($v in $evVM) {
|
||||
|
||||
$report = "" | select Name,EVCMode
|
||||
$report.Name = $v.Name
|
||||
$report.EVCMode = $v.ExtensionData.Runtime.MinRequiredEVCModeKey
|
||||
$output += $report
|
||||
|
||||
}
|
||||
|
||||
return $output
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function Remove-VMEvcMode {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Removes the EVC status of a VM
|
||||
.DESCRIPTION
|
||||
Will remove the EVC status for the specified VM
|
||||
.NOTES
|
||||
Author: Kyle Ruddy, @kmruddy, thatcouldbeaproblem.com
|
||||
.PARAMETER Name
|
||||
VM name which the function should be ran against
|
||||
.EXAMPLE
|
||||
Remove-VMEvcMode -Name vmName
|
||||
Removes the EVC status of the provided VM
|
||||
#>
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[Parameter(Mandatory=$true,Position=0,ValueFromPipelineByPropertyName=$true)]
|
||||
$Name
|
||||
)
|
||||
|
||||
Process {
|
||||
$evVM = @()
|
||||
$updateVM = @()
|
||||
|
||||
if ($name -is [string]) {$evVM += Get-VM -Name $Name -ErrorAction SilentlyContinue}
|
||||
elseif ($name -is [array]) {
|
||||
|
||||
if ($name[0] -is [string]) {
|
||||
$name | foreach {
|
||||
$evVM += Get-VM -Name $_ -ErrorAction SilentlyContinue
|
||||
}
|
||||
}
|
||||
elseif ($name[0] -is [VMware.VimAutomation.ViCore.Impl.V1.Inventory.InventoryItemImpl]) {$evVM = $name}
|
||||
|
||||
}
|
||||
elseif ($name -is [VMware.VimAutomation.ViCore.Impl.V1.Inventory.InventoryItemImpl]) {$evVM += $name}
|
||||
|
||||
if ($evVM -eq $null) {Write-Warning "No VMs found."}
|
||||
else {
|
||||
foreach ($v in $evVM) {
|
||||
|
||||
if (($v.HardwareVersion -ge 'vmx-14' -and $v.PowerState -eq 'PoweredOff') -or ($v.Version -ge 'v14' -and $v.PowerState -eq 'PoweredOff')) {
|
||||
|
||||
$v.ExtensionData.ApplyEvcModeVM_Task($null, $true) | Out-Null
|
||||
$updateVM += $v.Name
|
||||
|
||||
}
|
||||
else {Write-Warning $v.Name + " does not have the minimum requirements of being Hardware Version 14 and powered off."}
|
||||
|
||||
}
|
||||
|
||||
if ($updateVM) {
|
||||
|
||||
Start-Sleep -Seconds 2
|
||||
Get-VMEvcMode -Name $updateVM
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function Set-VMEvcMode {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Configures the EVC status of a VM
|
||||
.DESCRIPTION
|
||||
Will configure the EVC status for the specified VM
|
||||
.NOTES
|
||||
Author: Kyle Ruddy, @kmruddy, thatcouldbeaproblem.com
|
||||
.PARAMETER Name
|
||||
VM name which the function should be ran against
|
||||
.PARAMETER EvcMode
|
||||
The EVC Mode key which should be set
|
||||
.EXAMPLE
|
||||
Set-VMEvcMode -Name vmName -EvcMode intel-sandybridge
|
||||
Configures the EVC status of the provided VM to be 'intel-sandybridge'
|
||||
#>
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[Parameter(Mandatory=$true,Position=0,ValueFromPipelineByPropertyName=$true)]
|
||||
$Name,
|
||||
[Parameter(Mandatory=$true,Position=1)]
|
||||
[ValidateSet("intel-merom","intel-penryn","intel-nehalem","intel-westmere","intel-sandybridge","intel-ivybridge","intel-haswell","intel-broadwell","intel-skylake","amd-rev-e","amd-rev-f","amd-greyhound-no3dnow","amd-greyhound","amd-bulldozer","amd-piledriver","amd-steamroller","amd-zen")]
|
||||
$EvcMode
|
||||
)
|
||||
|
||||
Process {
|
||||
$evVM = @()
|
||||
$updateVM = @()
|
||||
|
||||
if ($name -is [string]) {$evVM += Get-VM -Name $Name -ErrorAction SilentlyContinue}
|
||||
elseif ($name -is [array]) {
|
||||
|
||||
if ($name[0] -is [string]) {
|
||||
$name | foreach {
|
||||
$evVM += Get-VM -Name $_ -ErrorAction SilentlyContinue
|
||||
}
|
||||
}
|
||||
elseif ($name[0] -is [VMware.VimAutomation.ViCore.Impl.V1.Inventory.InventoryItemImpl]) {$evVM = $name}
|
||||
|
||||
}
|
||||
elseif ($name -is [VMware.VimAutomation.ViCore.Impl.V1.Inventory.InventoryItemImpl]) {$evVM += $name}
|
||||
|
||||
if ($evVM -eq $null) {Write-Warning "No VMs found."}
|
||||
else {
|
||||
|
||||
$si = Get-View ServiceInstance
|
||||
$evcMask = $si.Capability.SupportedEvcMode | where-object {$_.key -eq $EvcMode} | select -ExpandProperty FeatureMask
|
||||
|
||||
foreach ($v in $evVM) {
|
||||
|
||||
if (($v.HardwareVersion -ge 'vmx-14' -and $v.PowerState -eq 'PoweredOff') -or ($v.Version -ge 'v14' -and $v.PowerState -eq 'PoweredOff')) {
|
||||
|
||||
$v.ExtensionData.ApplyEvcModeVM_Task($evcMask, $true) | Out-Null
|
||||
$updateVM += $v.Name
|
||||
|
||||
}
|
||||
else {Write-Warning $v.Name + " does not have the minimum requirements of being Hardware Version 14 and powered off."}
|
||||
|
||||
}
|
||||
|
||||
if ($updateVM) {
|
||||
|
||||
Start-Sleep -Seconds 2
|
||||
Get-VMEvcMode -Name $updateVM
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
1
Modules/SRM/.gitattributes
vendored
Normal file
1
Modules/SRM/.gitattributes
vendored
Normal file
@@ -0,0 +1 @@
|
||||
*.psd1 diff
|
||||
1
Modules/SRM/.gitignore
vendored
Normal file
1
Modules/SRM/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
*.zip
|
||||
167
Modules/SRM/Examples/ReportConfiguration.ps1
Normal file
167
Modules/SRM/Examples/ReportConfiguration.ps1
Normal file
@@ -0,0 +1,167 @@
|
||||
# Depends on SRM Helper Methods - https://github.com/benmeadowcroft/SRM-Cmdlets
|
||||
# It is assumed that the connection to VC and SRM Server have already been made
|
||||
|
||||
Function Get-SrmConfigReportSite {
|
||||
Param(
|
||||
[VMware.VimAutomation.Srm.Types.V1.SrmServer] $SrmServer
|
||||
)
|
||||
|
||||
Get-SrmServer $SrmServer |
|
||||
Format-Table -Wrap -AutoSize @{Label="SRM Site Name"; Expression={$_.ExtensionData.GetSiteName()} },
|
||||
@{Label="SRM Host"; Expression={$_.Name} },
|
||||
@{Label="SRM Port"; Expression={$_.Port} },
|
||||
@{Label="Version"; Expression={$_.Version} },
|
||||
@{Label="Build"; Expression={$_.Build} },
|
||||
@{Label="SRM Peer Site Name"; Expression={$_.ExtensionData.GetPairedSite().Name} }
|
||||
}
|
||||
|
||||
Function Get-SrmConfigReportPlan {
|
||||
Param(
|
||||
[VMware.VimAutomation.Srm.Types.V1.SrmServer] $SrmServer
|
||||
)
|
||||
|
||||
Get-SrmRecoveryPlan -SrmServer $SrmServer | %{
|
||||
$rp = $_
|
||||
$rpinfo = $rp.GetInfo()
|
||||
$peerState = $rp.GetPeer().State
|
||||
$pgs = Get-SrmProtectionGroup -RecoveryPlan $rp
|
||||
$pgnames = $pgs | %{ $_.GetInfo().Name }
|
||||
|
||||
$output = "" | select plan, state, peerState, groups
|
||||
$output.plan = $rpinfo.Name
|
||||
$output.state = $rpinfo.State
|
||||
$output.peerState = $peerState
|
||||
if ($pgnames) {
|
||||
$output.groups = [string]::Join(",`r`n", $pgnames)
|
||||
} else {
|
||||
$output.groups = "NONE"
|
||||
}
|
||||
|
||||
$output
|
||||
} | Format-Table -Wrap -AutoSize @{Label="Recovery Plan Name"; Expression={$_.plan} },
|
||||
@{Label="Recovery State"; Expression={$_.state} },
|
||||
@{Label="Peer Recovery State"; Expression={$_.peerState} },
|
||||
@{Label="Protection Groups"; Expression={$_.groups}}
|
||||
}
|
||||
|
||||
|
||||
Function Get-SrmConfigReportProtectionGroup {
|
||||
Param(
|
||||
[VMware.VimAutomation.Srm.Types.V1.SrmServer] $SrmServer
|
||||
)
|
||||
|
||||
Get-SrmProtectionGroup -SrmServer $SrmServer | %{
|
||||
$pg = $_
|
||||
$pginfo = $pg.GetInfo()
|
||||
$pgstate = $pg.GetProtectionState()
|
||||
$peerState = $pg.GetPeer().State
|
||||
$rps = Get-SrmRecoveryPlan -ProtectionGroup $pg
|
||||
$rpnames = $rps | %{ $_.GetInfo().Name }
|
||||
|
||||
$output = "" | select name, type, state, peerState, plans
|
||||
$output.name = $pginfo.Name
|
||||
$output.type = $pginfo.Type
|
||||
$output.state = $pgstate
|
||||
$output.peerState = $peerState
|
||||
if ($rpnames) {
|
||||
$output.plans = [string]::Join(",`r`n", $rpnames)
|
||||
} else {
|
||||
$output.plans = "NONE"
|
||||
}
|
||||
|
||||
$output
|
||||
} | Format-Table -Wrap -AutoSize @{Label="Protection Group Name"; Expression={$_.name} },
|
||||
@{Label="Type"; Expression={$_.type} },
|
||||
@{Label="Protection State"; Expression={$_.state} },
|
||||
@{Label="Peer Protection State"; Expression={$_.peerState} },
|
||||
@{Label="Recovery Plans"; Expression={$_.plans} }
|
||||
}
|
||||
|
||||
|
||||
Function Get-SrmConfigReportProtectedDatastore {
|
||||
Param(
|
||||
[VMware.VimAutomation.Srm.Types.V1.SrmServer] $SrmServer
|
||||
)
|
||||
|
||||
Get-SrmProtectionGroup -SrmServer $SrmServer -Type "san" | %{
|
||||
$pg = $_
|
||||
$pginfo = $pg.GetInfo()
|
||||
$pds = Get-SrmProtectedDatastore -ProtectionGroup $pg
|
||||
$pds | %{
|
||||
$pd = $_
|
||||
$output = "" | select datacenter, group, name, capacity, free
|
||||
$output.datacenter = $pd.Datacenter.Name
|
||||
$output.group = $pginfo.Name
|
||||
$output.name = $pd.Name
|
||||
$output.capacity = $pd.CapacityGB
|
||||
$output.free = $pd.FreeSpaceGB
|
||||
|
||||
$output
|
||||
|
||||
}
|
||||
} | Format-Table -Wrap -AutoSize -GroupBy "datacenter" @{Label="Datastore Name"; Expression={$_.name} },
|
||||
@{Label="Capacity GB"; Expression={$_.capacity} },
|
||||
@{Label="Free GB"; Expression={$_.free} },
|
||||
@{Label="Protection Group"; Expression={$_.group} }
|
||||
}
|
||||
|
||||
|
||||
Function Get-SrmConfigReportProtectedVm {
|
||||
Param(
|
||||
[VMware.VimAutomation.Srm.Types.V1.SrmServer] $SrmServer
|
||||
)
|
||||
|
||||
$srmversion = Get-SrmServerVersion -SrmServer $SrmServer
|
||||
$srmMajorVersion, $srmMinorVersion = $srmversion -split "\."
|
||||
|
||||
Get-SrmProtectionGroup -SrmServer $SrmServer | %{
|
||||
$pg = $_
|
||||
$pginfo = $pg.GetInfo()
|
||||
$pvms = Get-SrmProtectedVM -ProtectionGroup $pg
|
||||
$rps = Get-SrmRecoveryPlan -ProtectionGroup $pg
|
||||
$rpnames = $rps | %{ $_.GetInfo().Name }
|
||||
$pvms | %{
|
||||
$pvm = $_
|
||||
if ($srmMajorVersion -ge 6 -or ($srmMajorVersion -eq 5 -and $srmMinorVersion -eq 8)) {
|
||||
$rs = $rps | Select -First 1 | %{ $_.GetRecoverySettings($pvm.Vm.MoRef) }
|
||||
}
|
||||
$output = "" | select group, name, moRef, needsConfiguration, state, plans, priority, finalPowerState, preCallouts, postCallouts
|
||||
$output.group = $pginfo.Name
|
||||
$output.name = $pvm.Vm.Name
|
||||
$output.moRef = $pvm.Vm.MoRef # this is necessary in case we can't retrieve the name when VC is unavailable
|
||||
$output.needsConfiguration = $pvm.NeedsConfiguration
|
||||
$output.state = $pvm.State
|
||||
$output.plans = [string]::Join(",`r`n", $rpnames)
|
||||
if ($rs) {
|
||||
$output.priority = $rs.RecoveryPriority
|
||||
$output.finalPowerState = $rs.FinalPowerState
|
||||
$output.preCallouts = $rs.PrePowerOnCallouts.Count
|
||||
$output.postCallouts = $rs.PostPowerOnCallouts.Count
|
||||
}
|
||||
$output
|
||||
|
||||
}
|
||||
} | Format-Table -Wrap -AutoSize @{Label="VM Name"; Expression={$_.name} },
|
||||
@{Label="VM MoRef"; Expression={$_.moRef} },
|
||||
@{Label="Needs Config"; Expression={$_.needsConfiguration} },
|
||||
@{Label="VM Protection State"; Expression={$_.state} },
|
||||
@{Label="Protection Group"; Expression={$_.group} },
|
||||
@{Label="Recovery Plans"; Expression={$_.plans} },
|
||||
@{Label="Recovery Priority"; Expression={$_.priority} },
|
||||
@{Label="Final Power State"; Expression={$_.finalPowerState} },
|
||||
@{Label="Pre-PowerOn Callouts"; Expression={$_.preCallouts} },
|
||||
@{Label="Post-PowerOn Callouts"; Expression={$_.postCallouts} }
|
||||
|
||||
}
|
||||
|
||||
Function Get-SrmConfigReport {
|
||||
Param(
|
||||
[VMware.VimAutomation.Srm.Types.V1.SrmServer] $SrmServer
|
||||
)
|
||||
|
||||
Get-SrmConfigReportSite -SrmServer $SrmServer
|
||||
Get-SrmConfigReportPlan -SrmServer $SrmServer
|
||||
Get-SrmConfigReportProtectionGroup -SrmServer $SrmServer
|
||||
Get-SrmConfigReportProtectedDatastore -SrmServer $SrmServer
|
||||
Get-SrmConfigReportProtectedVm -SrmServer $SrmServer
|
||||
}
|
||||
34
Modules/SRM/Examples/SrmTagging.ps1
Normal file
34
Modules/SRM/Examples/SrmTagging.ps1
Normal file
@@ -0,0 +1,34 @@
|
||||
# Depends on SRM Helper Methods - https://github.com/benmeadowcroft/SRM-Cmdlets
|
||||
# It is assumed that the connections to active VC and SRM Server have already been made
|
||||
|
||||
Import-Module Meadowcroft.SRM -Prefix Srm
|
||||
|
||||
$TagCategoryName = 'Meadowcroft.SRM.VM'
|
||||
$TagCategoryDescription = 'Tag category for tagging VMs with SRM state'
|
||||
|
||||
# If the tag category doesn't exist, create it and the relevant tags
|
||||
$TagCategory = Get-TagCategory -Name $TagCategoryName -ErrorAction SilentlyContinue
|
||||
if (-Not $TagCategory) {
|
||||
Write-Output "Creating Tag Category $TagCategoryName"
|
||||
$TagCategory = New-TagCategory -Name $TagCategoryName -Description $TagCategoryDescription -EntityType 'VirtualMachine'
|
||||
|
||||
Write-Output "Creating Tag SrmProtectedVm"
|
||||
New-Tag -Name 'SrmProtectedVm' -Category $TagCategory -Description "VM protected by VMware SRM"
|
||||
Write-Output "Creating Tag SrmTestVm"
|
||||
New-Tag -Name 'SrmTestVm' -Category $TagCategory -Description "Test VM instantiated by VMware SRM"
|
||||
Write-Output "Creating Tag SrmPlaceholderVm"
|
||||
New-Tag -Name 'SrmPlaceholderVm' -Category $TagCategory -Description "Placeholder VM used by VMware SRM"
|
||||
}
|
||||
|
||||
$protectedVmTag = Get-Tag -Name 'SrmProtectedVm' -Category $TagCategory
|
||||
$testVmTag = Get-Tag -Name 'SrmTestVm' -Category $TagCategory
|
||||
$placeholderVmTag = Get-Tag -Name 'SrmPlaceholderVm' -Category $TagCategory
|
||||
|
||||
# Assign protected tag to a VM, use ready state to get "local" protected VMs
|
||||
Get-SrmProtectedVM -State Ready | %{ New-TagAssignment -Tag $protectedVmTag -Entity $(Get-VIObjectByVIView $_.Vm) | Out-Null }
|
||||
|
||||
# Assign test tag to a VM
|
||||
Get-SrmTestVM | %{ New-TagAssignment -Tag $testVmTag -Entity $_ | Out-Null }
|
||||
|
||||
# Assign placeholder tag to a VM
|
||||
Get-SrmPlaceholderVM | %{ New-TagAssignment -Tag $placeholderVmTag -Entity $_ | Out-Null }
|
||||
74
Modules/SRM/LICENSE.txt
Normal file
74
Modules/SRM/LICENSE.txt
Normal file
@@ -0,0 +1,74 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
|
||||
(a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
|
||||
(b) You must cause any modified files to carry prominent notices stating that You changed the files; and
|
||||
(c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
|
||||
(d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied.
|
||||
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
|
||||
422
Modules/SRM/Meadowcroft.Srm.Protection.ps1
Normal file
422
Modules/SRM/Meadowcroft.Srm.Protection.ps1
Normal file
@@ -0,0 +1,422 @@
|
||||
# SRM Helper Methods - https://github.com/benmeadowcroft/SRM-Cmdlets
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Get the subset of protection groups matching the input criteria
|
||||
|
||||
.PARAMETER Name
|
||||
Return protection groups matching the specified name
|
||||
|
||||
.PARAMETER Type
|
||||
Return protection groups matching the specified protection group
|
||||
type. For SRM 5.0-5.5 this is either 'san' for protection groups
|
||||
consisting of a set of replicated datastores or 'vr' for vSphere
|
||||
Replication based protection groups.
|
||||
|
||||
.PARAMETER RecoveryPlan
|
||||
Return protection groups associated with a particular recovery
|
||||
plan
|
||||
|
||||
.PARAMETER SrmServer
|
||||
the SRM server to use for this operation.
|
||||
#>
|
||||
Function Get-ProtectionGroup {
|
||||
[cmdletbinding()]
|
||||
Param(
|
||||
[Parameter(position=1)][string] $Name,
|
||||
[string] $Type,
|
||||
[Parameter (ValueFromPipeline=$true)][VMware.VimAutomation.Srm.Views.SrmRecoveryPlan[]] $RecoveryPlan,
|
||||
[VMware.VimAutomation.Srm.Types.V1.SrmServer] $SrmServer
|
||||
)
|
||||
begin {
|
||||
$api = Get-ServerApiEndpoint -SrmServer $SrmServer
|
||||
$pgs = @()
|
||||
}
|
||||
process {
|
||||
if ($RecoveryPlan) {
|
||||
foreach ($rp in $RecoveryPlan) {
|
||||
$pgs += $RecoveryPlan.GetInfo().ProtectionGroups
|
||||
}
|
||||
$pgs = Select_UniqueByMoRef($pgs)
|
||||
} else {
|
||||
$pgs += $api.Protection.ListProtectionGroups()
|
||||
}
|
||||
}
|
||||
end {
|
||||
$pgs | ForEach-Object {
|
||||
$pg = $_
|
||||
$pgi = $pg.GetInfo()
|
||||
$selected = (-not $Name -or ($Name -eq $pgi.Name)) -and (-not $Type -or ($Type -eq $pgi.Type))
|
||||
if ($selected) {
|
||||
Add-Member -InputObject $pg -MemberType NoteProperty -Name "Name" -Value $pgi.Name
|
||||
$pg
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Get the subset of protected VMs matching the input criteria
|
||||
|
||||
.PARAMETER Name
|
||||
Return protected VMs matching the specified name
|
||||
|
||||
.PARAMETER State
|
||||
Return protected VMs matching the specified state. For protected
|
||||
VMs on the protected site this is usually 'ready', for
|
||||
placeholder VMs this is 'shadowing'
|
||||
|
||||
.PARAMETER ProtectionGroup
|
||||
Return protected VMs associated with particular protection
|
||||
groups
|
||||
#>
|
||||
Function Get-ProtectedVM {
|
||||
[cmdletbinding()]
|
||||
Param(
|
||||
[Parameter(position=1)][string] $Name,
|
||||
[VMware.VimAutomation.Srm.Views.SrmProtectionGroupProtectionState] $State,
|
||||
[VMware.VimAutomation.Srm.Views.SrmProtectionGroupProtectionState] $PeerState,
|
||||
[switch] $ConfiguredOnly,
|
||||
[switch] $UnconfiguredOnly,
|
||||
[Parameter (ValueFromPipeline=$true)][VMware.VimAutomation.Srm.Views.SrmProtectionGroup[]] $ProtectionGroup,
|
||||
[Parameter (ValueFromPipeline=$true)][VMware.VimAutomation.Srm.Views.SrmRecoveryPlan[]] $RecoveryPlan,
|
||||
[string] $ProtectionGroupName,
|
||||
[VMware.VimAutomation.Srm.Types.V1.SrmServer] $SrmServer
|
||||
)
|
||||
|
||||
if ($null -eq $ProtectionGroup) {
|
||||
$ProtectionGroup = Get-ProtectionGroup -Name $ProtectionGroupName -RecoveryPlan $RecoveryPlan -SrmServer $SrmServer
|
||||
}
|
||||
$ProtectionGroup | ForEach-Object {
|
||||
$pg = $_
|
||||
$pg.ListProtectedVms() | ForEach-Object {
|
||||
# try and update the view data for the protected VM
|
||||
try {
|
||||
$_.Vm.UpdateViewData()
|
||||
} catch {
|
||||
Write-Error $_
|
||||
} finally {
|
||||
$_
|
||||
}
|
||||
} | Where-object { -not $Name -or ($Name -eq $_.Vm.Name) } |
|
||||
where-object { -not $State -or ($State -eq $_.State) } |
|
||||
where-object { -not $PeerState -or ($PeerState -eq $_.PeerState) } |
|
||||
where-object { ($ConfiguredOnly -and $_.NeedsConfiguration -eq $false) -or ($UnconfiguredOnly -and $_.NeedsConfiguration -eq $true) -or (-not $ConfiguredOnly -and -not $UnconfiguredOnly) }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Get the unprotected VMs that are associated with a protection group
|
||||
|
||||
.PARAMETER ProtectionGroup
|
||||
Return unprotected VMs associated with particular protection
|
||||
groups. For VR protection groups this is VMs that are associated
|
||||
with the PG but not configured, For ABR protection groups this is
|
||||
VMs on replicated datastores associated with the group that are not
|
||||
configured.
|
||||
#>
|
||||
Function Get-UnProtectedVM {
|
||||
[cmdletbinding()]
|
||||
Param(
|
||||
[Parameter (ValueFromPipeline=$true)][VMware.VimAutomation.Srm.Views.SrmProtectionGroup[]] $ProtectionGroup,
|
||||
[Parameter (ValueFromPipeline=$true)][VMware.VimAutomation.Srm.Views.SrmRecoveryPlan[]] $RecoveryPlan,
|
||||
[string] $ProtectionGroupName,
|
||||
[VMware.VimAutomation.Srm.Types.V1.SrmServer] $SrmServer
|
||||
)
|
||||
|
||||
if ($null -eq $ProtectionGroup) {
|
||||
$ProtectionGroup = Get-ProtectionGroup -Name $ProtectionGroupName -RecoveryPlan $RecoveryPlan -SrmServer $SrmServer
|
||||
}
|
||||
|
||||
$associatedVMs = @()
|
||||
$protectedVmRefs = @()
|
||||
|
||||
$ProtectionGroup | ForEach-Object {
|
||||
$pg = $_
|
||||
# For VR listAssociatedVms to get list of VMs
|
||||
if ($pg.GetInfo().Type -eq 'vr') {
|
||||
$associatedVMs += @($pg.ListAssociatedVms() | Get-VIObjectByVIView)
|
||||
}
|
||||
# TODO test this: For ABR get VMs on GetProtectedDatastore
|
||||
if ($pg.GetInfo().Type -eq 'san') {
|
||||
$pds = @(Get-ProtectedDatastore -ProtectionGroup $pg)
|
||||
$pds | ForEach-Object {
|
||||
$ds = Get-Datastore -id $_.MoRef
|
||||
$associatedVMs += @(Get-VM -Datastore $ds)
|
||||
}
|
||||
}
|
||||
|
||||
# get protected VMs
|
||||
$protectedVmRefs += @(Get-ProtectedVM -ProtectionGroup $pg | ForEach-Object { $_.Vm.MoRef } | Select-Object -Unique)
|
||||
}
|
||||
|
||||
# get associated but unprotected VMs
|
||||
$associatedVMs | Where-Object { $protectedVmRefs -notcontains $_.ExtensionData.MoRef }
|
||||
}
|
||||
|
||||
|
||||
#Untested as I don't have ABR setup in my lab yet
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Get the subset of protected Datastores matching the input criteria
|
||||
|
||||
.PARAMETER ProtectionGroup
|
||||
Return protected datastores associated with particular protection
|
||||
groups
|
||||
#>
|
||||
Function Get-ProtectedDatastore {
|
||||
[cmdletbinding()]
|
||||
Param(
|
||||
[Parameter (ValueFromPipeline=$true)][VMware.VimAutomation.Srm.Views.SrmProtectionGroup[]] $ProtectionGroup,
|
||||
[Parameter (ValueFromPipeline=$true)][VMware.VimAutomation.Srm.Views.SrmRecoveryPlan[]] $RecoveryPlan,
|
||||
[string] $ProtectionGroupName,
|
||||
[VMware.VimAutomation.Srm.Types.V1.SrmServer] $SrmServer
|
||||
)
|
||||
|
||||
if (-not $ProtectionGroup) {
|
||||
$ProtectionGroup = Get-ProtectionGroup -Name $ProtectionGroupName -RecoveryPlan $RecoveryPlan -SrmServer $SrmServer
|
||||
}
|
||||
$ProtectionGroup | ForEach-Object {
|
||||
$pg = $_
|
||||
if ($pg.GetInfo().Type -eq 'san') { # only supported for array based replication datastores
|
||||
$pg.ListProtectedDatastores()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#Untested as I don't have ABR setup in my lab yet
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Get the replicated datastores that aren't associated with a protection group.
|
||||
#>
|
||||
Function Get-ReplicatedDatastore {
|
||||
[cmdletbinding()]
|
||||
Param(
|
||||
[VMware.VimAutomation.Srm.Types.V1.SrmServer] $SrmServer
|
||||
)
|
||||
|
||||
$api = Get-ServerApiEndpoint -SrmServer $SrmServer
|
||||
|
||||
$api.Protection.ListUnassignedReplicatedDatastores()
|
||||
}
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Protect a VM using SRM
|
||||
|
||||
.PARAMETER ProtectionGroup
|
||||
The protection group that this VM will belong to
|
||||
|
||||
.PARAMETER Vm
|
||||
The virtual machine to protect
|
||||
#>
|
||||
Function Protect-VM {
|
||||
[cmdletbinding()]
|
||||
Param(
|
||||
[Parameter (Mandatory=$true)][VMware.VimAutomation.Srm.Views.SrmProtectionGroup] $ProtectionGroup,
|
||||
[Parameter (ValueFromPipeline=$true)][VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine] $Vm,
|
||||
[Parameter (ValueFromPipeline=$true)][VMware.Vim.VirtualMachine] $VmView
|
||||
)
|
||||
|
||||
$moRef = Get_MoRefFromVmObj -Vm $Vm -VmView $VmView
|
||||
|
||||
$pgi = $ProtectionGroup.GetInfo()
|
||||
#TODO query protection status first
|
||||
|
||||
if ($moRef) {
|
||||
if ($pgi.Type -eq 'vr') {
|
||||
$ProtectionGroup.AssociateVms(@($moRef))
|
||||
}
|
||||
$protectionSpec = New-Object VMware.VimAutomation.Srm.Views.SrmProtectionGroupVmProtectionSpec
|
||||
$protectionSpec.Vm = $moRef
|
||||
$protectTask = $ProtectionGroup.ProtectVms($protectionSpec)
|
||||
while(-not $protectTask.IsComplete()) { Start-Sleep -Seconds 1 }
|
||||
$protectTask.GetResult()
|
||||
} else {
|
||||
throw "Can't protect the VM, no MoRef found."
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Unprotect a VM using SRM
|
||||
|
||||
.PARAMETER ProtectionGroup
|
||||
The protection group that this VM will be removed from
|
||||
|
||||
.PARAMETER Vm
|
||||
The virtual machine to unprotect
|
||||
#>
|
||||
Function Unprotect-VM {
|
||||
[cmdletbinding()]
|
||||
Param(
|
||||
[Parameter (Mandatory=$true)][VMware.VimAutomation.Srm.Views.SrmProtectionGroup] $ProtectionGroup,
|
||||
[Parameter (ValueFromPipeline=$true)][VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine] $Vm,
|
||||
[Parameter (ValueFromPipeline=$true)][VMware.Vim.VirtualMachine] $VmView,
|
||||
[Parameter (ValueFromPipeline=$true)][VMware.VimAutomation.Srm.Views.SrmProtectionGroupProtectedVm] $ProtectedVm
|
||||
)
|
||||
|
||||
$moRef = Get_MoRefFromVmObj -Vm $Vm -VmView $VmView -ProtectedVm $ProtectedVm
|
||||
|
||||
$pgi = $ProtectionGroup.GetInfo()
|
||||
$protectTask = $ProtectionGroup.UnprotectVms($moRef)
|
||||
while(-not $protectTask.IsComplete()) { Start-Sleep -Seconds 1 }
|
||||
if ($pgi.Type -eq 'vr') {
|
||||
$ProtectionGroup.UnassociateVms(@($moRef))
|
||||
}
|
||||
$protectTask.GetResult()
|
||||
}
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Get a protection group folder
|
||||
|
||||
.PARAMETER SrmServer
|
||||
The SRM Server to query for the protection group folder
|
||||
#>
|
||||
Function Get-ProtectionGroupFolder {
|
||||
[cmdletbinding()]
|
||||
Param(
|
||||
[VMware.VimAutomation.Srm.Types.V1.SrmServer] $SrmServer
|
||||
)
|
||||
|
||||
$api = Get-ServerApiEndpoint -SrmServer $SrmServer
|
||||
|
||||
$folder = $api.Protection.GetProtectionGroupRootFolder()
|
||||
|
||||
return $folder
|
||||
}
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Create a new protection group
|
||||
|
||||
.PARAMETER Name
|
||||
The name of the protection group
|
||||
|
||||
.PARAMETER Description
|
||||
Description of the protection group
|
||||
|
||||
.PARAMETER Folder
|
||||
The protection group folder in which to create the new protection group
|
||||
|
||||
.PARAMETER ArrayReplication
|
||||
Set if protection group is for replicating VMs using Array based replication
|
||||
|
||||
.PARAMETER vSphereReplication
|
||||
Set if protection group is for replicating VMs with vSphere Replication
|
||||
|
||||
.PARAMETER VMs
|
||||
For vSphere Replication based protection, the VMs to add to the replication
|
||||
group. These should already be replicated.
|
||||
|
||||
.PARAMETER VMViews
|
||||
For vSphere Replication based protection, the VMs to add to the replication
|
||||
group. These should already be replicated.
|
||||
|
||||
.PARAMETER SrmServer
|
||||
The SRM Server to perform the operation against
|
||||
#>
|
||||
Function New-ProtectionGroup {
|
||||
[cmdletbinding(DefaultParameterSetName="VR", SupportsShouldProcess=$True, ConfirmImpact="Medium")]
|
||||
[OutputType([VMware.VimAutomation.Srm.Views.SrmProtectionGroup])]
|
||||
Param(
|
||||
[Parameter (Mandatory=$true)] $Name,
|
||||
$Description,
|
||||
[VMware.VimAutomation.Srm.Views.SrmProtectionGroupFolder] $Folder,
|
||||
[Parameter (ParameterSetName="ABR", Mandatory=$true)][switch] $ArrayReplication,
|
||||
[Parameter (ValueFromPipeline=$true, ParameterSetName="ABR")][VMware.VimAutomation.ViCore.Types.V1.DatastoreManagement.Datastore[]] $Datastores,
|
||||
[Parameter (ValueFromPipeline=$true, ParameterSetName="ABR")][VMware.Vim.Datastore[]] $DatastoreViews,
|
||||
[Parameter (ParameterSetName="VR", Mandatory=$true)][switch] $vSphereReplication,
|
||||
[Parameter (ValueFromPipeline=$true, ParameterSetName="VR")][VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine[]] $VMs,
|
||||
[Parameter (ValueFromPipeline=$true, ParameterSetName="VR")][VMware.Vim.VirtualMachine[]] $VMViews,
|
||||
[VMware.VimAutomation.Srm.Types.V1.SrmServer] $SrmServer
|
||||
)
|
||||
|
||||
$api = Get-ServerApiEndpoint $SrmServer
|
||||
[VMware.VimAutomation.Srm.Views.SrmCreateProtectionGroupTask] $task = $null
|
||||
|
||||
#get root folder if this wasn't specified as a parameter
|
||||
if(-not $Folder) {
|
||||
$Folder = Get-ProtectionGroupFolder -SrmServer $SrmServer
|
||||
}
|
||||
|
||||
if ($vSphereReplication) {
|
||||
#create list of managed object references from VM and/or VM view arrays
|
||||
[VMware.Vim.ManagedObjectReference[]]$moRefs = @()
|
||||
foreach ($vm in $VMs) {
|
||||
$moRefs += Get_MoRefFromVmObj -Vm $Vm
|
||||
}
|
||||
foreach ($VmView in $VMViews) {
|
||||
$moRefs += Get_MoRefFromVmObj -VmView $VmView
|
||||
}
|
||||
|
||||
if ($pscmdlet.ShouldProcess($Name, "New")) {
|
||||
$task = $api.Protection.CreateHbrProtectionGroup($Folder.MoRef, $Name, $Description, $moRefs)
|
||||
}
|
||||
|
||||
} elseif ($ArrayReplication) {
|
||||
#create list of managed object references from VM and/or VM view arrays
|
||||
$moRefs = @()
|
||||
foreach ($ds in $Datastores) {
|
||||
$moRefs += $ds.ExtensionData.MoRef
|
||||
}
|
||||
foreach ($DsView in $DatastoreViews) {
|
||||
$moRefs += $DsView.MoRef
|
||||
}
|
||||
|
||||
if ($pscmdlet.ShouldProcess($Name, "New")) {
|
||||
$task = $api.Protection.CreateAbrProtectionGroup($Folder.MoRef, $Name, $Description, $moRefs)
|
||||
}
|
||||
|
||||
} else {
|
||||
throw "Undetermined protection group type"
|
||||
}
|
||||
|
||||
# Complete task
|
||||
while(-not $task.IsCreateProtectionGroupComplete()) { Start-Sleep -Seconds 1 }
|
||||
|
||||
# Retrieve the protection group, and protect associated VMs
|
||||
$pg = $task.GetNewProtectionGroup()
|
||||
if ($pg) {
|
||||
$unProtectedVMs = Get-UnProtectedVM -ProtectionGroup $pg
|
||||
$unProtectedVMs | Protect-VM -ProtectionGroup $pg
|
||||
}
|
||||
|
||||
return $pg
|
||||
}
|
||||
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Delete a protection group
|
||||
|
||||
.PARAMETER ProtectionGroup
|
||||
The protection group to remove
|
||||
|
||||
.PARAMETER SrmServer
|
||||
The SRM Server to perform the operation against
|
||||
#>
|
||||
Function Remove-ProtectionGroup {
|
||||
[cmdletbinding(SupportsShouldProcess=$True, ConfirmImpact="High")]
|
||||
[OutputType([VMware.VimAutomation.Srm.Views.RemoveProtectionGroupTask])]
|
||||
Param(
|
||||
[Parameter (Mandatory=$true, ValueFromPipeline=$true)][VMware.VimAutomation.Srm.Views.SrmProtectionGroup] $ProtectionGroup,
|
||||
[VMware.VimAutomation.Srm.Types.V1.SrmServer] $SrmServer
|
||||
)
|
||||
|
||||
$api = Get-ServerApiEndpoint $SrmServer
|
||||
[VMware.VimAutomation.Srm.Views.RemoveProtectionGroupTask] $task = $null
|
||||
|
||||
$pginfo = $ProtectionGroup.GetInfo()
|
||||
if ($pscmdlet.ShouldProcess($pginfo.Name, "Remove")) {
|
||||
$task = $api.Protection.RemoveProtectionGroup($ProtectionGroup.MoRef)
|
||||
}
|
||||
|
||||
return $task
|
||||
}
|
||||
556
Modules/SRM/Meadowcroft.Srm.Recovery.ps1
Normal file
556
Modules/SRM/Meadowcroft.Srm.Recovery.ps1
Normal file
@@ -0,0 +1,556 @@
|
||||
# SRM Helper Methods - https://github.com/benmeadowcroft/SRM-Cmdlets
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Get the subset of recovery plans matching the input criteria
|
||||
|
||||
.PARAMETER Name
|
||||
Return recovery plans matching the specified name
|
||||
|
||||
.PARAMETER ProtectionGroup
|
||||
Return recovery plans associated with particular protection
|
||||
groups
|
||||
#>
|
||||
Function Get-RecoveryPlan {
|
||||
[cmdletbinding()]
|
||||
Param(
|
||||
[Parameter(position=1)][string] $Name,
|
||||
[Parameter (ValueFromPipeline=$true)][VMware.VimAutomation.Srm.Views.SrmProtectionGroup[]] $ProtectionGroup,
|
||||
[VMware.VimAutomation.Srm.Types.V1.SrmServer] $SrmServer
|
||||
)
|
||||
|
||||
begin {
|
||||
$api = Get-ServerApiEndpoint -SrmServer $SrmServer
|
||||
$rps = @()
|
||||
}
|
||||
process {
|
||||
if ($ProtectionGroup) {
|
||||
foreach ($pg in $ProtectionGroup) {
|
||||
$rps += $pg.ListRecoveryPlans()
|
||||
}
|
||||
$rps = Select_UniqueByMoRef($rps)
|
||||
} else {
|
||||
$rps += $api.Recovery.ListPlans()
|
||||
}
|
||||
}
|
||||
end {
|
||||
$rps | ForEach-Object {
|
||||
$rp = $_
|
||||
$rpi = $rp.GetInfo()
|
||||
$selected = (-not $Name -or ($Name -eq $rpi.Name))
|
||||
if ($selected) {
|
||||
Add-Member -InputObject $rp -MemberType NoteProperty -Name "Name" -Value $rpi.Name
|
||||
$rp
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Start a Recovery Plan action like test, recovery, cleanup, etc.
|
||||
|
||||
.PARAMETER RecoveryPlan
|
||||
The recovery plan to start
|
||||
|
||||
.PARAMETER RecoveryMode
|
||||
The recovery mode to invoke on the plan. May be one of "Test", "Cleanup", "Failover", "Migrate", "Reprotect"
|
||||
#>
|
||||
Function Start-RecoveryPlan {
|
||||
[cmdletbinding(SupportsShouldProcess=$True, ConfirmImpact="High")]
|
||||
Param(
|
||||
[Parameter (Mandatory=$true, ValueFromPipeline=$true, Position=1)][VMware.VimAutomation.Srm.Views.SrmRecoveryPlan] $RecoveryPlan,
|
||||
[VMware.VimAutomation.Srm.Views.SrmRecoveryPlanRecoveryMode] $RecoveryMode = [VMware.VimAutomation.Srm.Views.SrmRecoveryPlanRecoveryMode]::Test,
|
||||
[bool] $SyncData = $True
|
||||
)
|
||||
|
||||
# Validate with informative error messages
|
||||
$rpinfo = $RecoveryPlan.GetInfo()
|
||||
|
||||
# Create recovery options
|
||||
$rpOpt = New-Object VMware.VimAutomation.Srm.Views.SrmRecoveryOptions
|
||||
$rpOpt.SyncData = $SyncData
|
||||
|
||||
# Prompt the user to confirm they want to execute the action
|
||||
if ($pscmdlet.ShouldProcess($rpinfo.Name, $RecoveryMode)) {
|
||||
if ($rpinfo.State -eq 'Protecting') {
|
||||
throw "This recovery plan action needs to be initiated from the other SRM instance"
|
||||
}
|
||||
|
||||
$RecoveryPlan.Start($RecoveryMode, $rpOpt)
|
||||
}
|
||||
}
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Stop a running Recovery Plan action.
|
||||
|
||||
.PARAMETER RecoveryPlan
|
||||
The recovery plan to stop
|
||||
#>
|
||||
Function Stop-RecoveryPlan {
|
||||
[cmdletbinding(SupportsShouldProcess=$True,ConfirmImpact="High")]
|
||||
Param(
|
||||
[Parameter (Mandatory=$true, ValueFromPipeline=$true, Position=1)][VMware.VimAutomation.Srm.Views.SrmRecoveryPlan] $RecoveryPlan
|
||||
)
|
||||
|
||||
# Validate with informative error messages
|
||||
$rpinfo = $RecoveryPlan.GetInfo()
|
||||
|
||||
# Prompt the user to confirm they want to cancel the running action
|
||||
if ($pscmdlet.ShouldProcess($rpinfo.Name, 'Cancel')) {
|
||||
|
||||
$RecoveryPlan.Cancel()
|
||||
}
|
||||
}
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Retrieve the historical results of a recovery plan
|
||||
|
||||
.PARAMETER RecoveryPlan
|
||||
The recovery plan to retrieve the history for
|
||||
#>
|
||||
Function Get-RecoveryPlanResult {
|
||||
[cmdletbinding()]
|
||||
Param(
|
||||
[Parameter (Mandatory=$true, ValueFromPipeline=$true, Position=1)][VMware.VimAutomation.Srm.Views.SrmRecoveryPlan] $RecoveryPlan,
|
||||
[VMware.VimAutomation.Srm.Views.SrmRecoveryPlanRecoveryMode] $RecoveryMode,
|
||||
[VMware.VimAutomation.Srm.Views.SrmRecoveryResultResultState] $ResultState,
|
||||
[DateTime] $StartedAfter,
|
||||
[DateTime] $startedBefore,
|
||||
[VMware.VimAutomation.Srm.Types.V1.SrmServer] $SrmServer
|
||||
)
|
||||
|
||||
$api = Get-ServerApiEndpoint -SrmServer $SrmServer
|
||||
|
||||
# Get the history objects
|
||||
$history = $api.Recovery.GetHistory($RecoveryPlan.MoRef)
|
||||
$resultCount = $history.GetResultCount()
|
||||
|
||||
if ($resultCount -gt 0) {
|
||||
$results = $history.GetRecoveryResult($resultCount)
|
||||
|
||||
$results |
|
||||
Where-Object { -not $RecoveryMode -or $_.RunMode -eq $RecoveryMode } |
|
||||
Where-Object { -not $ResultState -or $_.ResultState -eq $ResultState } |
|
||||
Where-Object { $null -eq $StartedAfter -or $_.StartTime -gt $StartedAfter } |
|
||||
Where-Object { $null -eq $StartedBefore -or $_.StartTime -lt $StartedBefore }
|
||||
}
|
||||
}
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Exports a recovery plan result object to XML format
|
||||
|
||||
.PARAMETER RecoveryPlanResult
|
||||
The recovery plan result to export
|
||||
#>
|
||||
Function Export-RecoveryPlanResultAsXml {
|
||||
[cmdletbinding()]
|
||||
[OutputType([xml])]
|
||||
Param(
|
||||
[Parameter (Mandatory=$true, ValueFromPipeline=$true, Position=1)][VMware.VimAutomation.Srm.Views.SrmRecoveryResult] $RecoveryPlanResult,
|
||||
[VMware.VimAutomation.Srm.Types.V1.SrmServer] $SrmServer
|
||||
)
|
||||
|
||||
$api = Get-ServerApiEndpoint -SrmServer $SrmServer
|
||||
|
||||
$RecoveryPlan = $RecoveryPlanResult.Plan
|
||||
$history = $api.Recovery.GetHistory($RecoveryPlan.MoRef)
|
||||
$lines = $history.GetResultLength($RecoveryPlanResult.Key)
|
||||
[xml] $history.RetrieveStatus($RecoveryPlanResult.Key, 0, $lines)
|
||||
}
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Add a protection group to a recovery plan. This requires SRM 5.8 or later.
|
||||
|
||||
.PARAMETER RecoveryPlan
|
||||
The recovery plan the protection group will be associated with
|
||||
|
||||
.PARAMETER ProtectionGroup
|
||||
The protection group to associate with the recovery plan
|
||||
#>
|
||||
Function Add-ProtectionGroupToRecoveryPlan {
|
||||
[cmdletbinding()]
|
||||
Param(
|
||||
[Parameter (Mandatory=$true, Position=1)][VMware.VimAutomation.Srm.Views.SrmRecoveryPlan] $RecoveryPlan,
|
||||
[Parameter (Mandatory=$true, ValueFromPipeline=$true, Position=2)][VMware.VimAutomation.Srm.Views.SrmProtectionGroup] $ProtectionGroup
|
||||
)
|
||||
|
||||
if ($RecoveryPlan -and $ProtectionGroup) {
|
||||
foreach ($pg in $ProtectionGroup) {
|
||||
try {
|
||||
$RecoveryPlan.AddProtectionGroup($pg.MoRef)
|
||||
} catch {
|
||||
Write-Error $_
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Remove a protection group to a recovery plan. This requires SRM 6.5 or later.
|
||||
|
||||
.PARAMETER RecoveryPlan
|
||||
The recovery plan the protection group will be disassociated from
|
||||
|
||||
.PARAMETER ProtectionGroup
|
||||
The protection group to disassociate from the recovery plan
|
||||
#>
|
||||
Function Remove-ProtectionGroupFromRecoveryPlan {
|
||||
[cmdletbinding()]
|
||||
Param(
|
||||
[Parameter (Mandatory=$true)][VMware.VimAutomation.Srm.Views.SrmRecoveryPlan] $RecoveryPlan,
|
||||
[Parameter (Mandatory=$true)][VMware.VimAutomation.Srm.Views.SrmProtectionGroup] $ProtectionGroup
|
||||
)
|
||||
|
||||
if ($RecoveryPlan -and $ProtectionGroup) {
|
||||
foreach ($pg in $ProtectionGroup) {
|
||||
try {
|
||||
$RecoveryPlan.RemoveProtectionGroupFromRecoveryPlan($pg.MoRef)
|
||||
} catch {
|
||||
Write-Error $_
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Get the recovery settings of a protected VM. This requires SRM 5.8 or later.
|
||||
|
||||
.PARAMETER RecoveryPlan
|
||||
The recovery plan the settings will be retrieved from.
|
||||
|
||||
.PARAMETER Vm
|
||||
The virtual machine to retieve recovery settings for.
|
||||
|
||||
#>
|
||||
Function Get-RecoverySetting {
|
||||
[cmdletbinding()]
|
||||
Param(
|
||||
[Parameter (Mandatory=$true)][VMware.VimAutomation.Srm.Views.SrmRecoveryPlan] $RecoveryPlan,
|
||||
[Parameter (ValueFromPipeline=$true)][VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine] $Vm,
|
||||
[Parameter (ValueFromPipeline=$true)][VMware.Vim.VirtualMachine] $VmView,
|
||||
[Parameter (ValueFromPipeline=$true)][VMware.VimAutomation.Srm.Views.SrmProtectionGroupProtectedVm] $ProtectedVm
|
||||
)
|
||||
|
||||
$moRef = Get_MoRefFromVmObj -Vm $Vm -VmView $VmView -ProtectedVm $ProtectedVm
|
||||
|
||||
if ($RecoveryPlan -and $moRef) {
|
||||
$RecoveryPlan.GetRecoverySettings($moRef)
|
||||
}
|
||||
}
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Get the recovery settings of a protected VM. This requires SRM 5.8 or later.
|
||||
|
||||
.PARAMETER RecoveryPlan
|
||||
The recovery plan the settings will be retrieved from.
|
||||
|
||||
.PARAMETER Vm
|
||||
The virtual machine to configure recovery settings on.
|
||||
|
||||
.PARAMETER RecoverySettings
|
||||
The recovery settings to configure. These should have been retrieved via a
|
||||
call to Get-RecoverySettings
|
||||
|
||||
#>
|
||||
Function Set-RecoverySetting {
|
||||
[cmdletbinding(SupportsShouldProcess=$true, ConfirmImpact="Medium")]
|
||||
Param(
|
||||
[Parameter (Mandatory=$true)][VMware.VimAutomation.Srm.Views.SrmRecoveryPlan] $RecoveryPlan,
|
||||
[Parameter (ValueFromPipeline=$true)][VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine] $Vm,
|
||||
[Parameter (ValueFromPipeline=$true)][VMware.Vim.VirtualMachine] $VmView,
|
||||
[Parameter (ValueFromPipeline=$true)][VMware.VimAutomation.Srm.Views.SrmProtectionGroupProtectedVm] $ProtectedVm,
|
||||
[Parameter (Mandatory=$true, ValueFromPipeline=$true)][VMware.VimAutomation.Srm.Views.SrmRecoverySettings] $RecoverySettings
|
||||
)
|
||||
|
||||
|
||||
$moRef = Get_MoRefFromVmObj -Vm $Vm -VmView $VmView -ProtectedVm $ProtectedVm
|
||||
|
||||
if ($RecoveryPlan -and $moRef -and $RecoverySettings) {
|
||||
if ($PSCmdlet.ShouldProcess("$moRef", "Set")) {
|
||||
$RecoveryPlan.SetRecoverySettings($moRef, $RecoverySettings)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Create a new per-Vm command to add to the SRM Recovery Plan
|
||||
|
||||
.PARAMETER Command
|
||||
The command script to execute.
|
||||
|
||||
.PARAMETER Description
|
||||
The user friendly description of this script.
|
||||
|
||||
.PARAMETER Timeout
|
||||
The number of seconds this command has to execute before it will be timedout.
|
||||
|
||||
.PARAMETER RunInRecoveredVm
|
||||
For a post-power on command this flag determines whether it will run on the
|
||||
recovered VM or on the SRM server.
|
||||
|
||||
#>
|
||||
Function New-Command {
|
||||
[cmdletbinding(SupportsShouldProcess=$true, ConfirmImpact="None")]
|
||||
Param(
|
||||
[Parameter (Mandatory=$true)][string] $Command,
|
||||
[Parameter (Mandatory=$true)][string] $Description,
|
||||
[int] $Timeout = 300,
|
||||
[switch] $RunInRecoveredVm = $false
|
||||
)
|
||||
|
||||
if($PSCmdlet.ShouldProcess("Description", "New")) {
|
||||
$srmWsdlCmd = New-Object VMware.VimAutomation.Srm.WsdlTypes.SrmCommand
|
||||
$srmCmd = New-Object VMware.VimAutomation.Srm.Views.SrmCommand -ArgumentList $srmWsdlCmd
|
||||
$srmCmd.Command = $Command
|
||||
$srmCmd.Description = $Description
|
||||
$srmCmd.RunInRecoveredVm = $RunInRecoveredVm
|
||||
$srmCmd.Timeout = $Timeout
|
||||
$srmCmd.Uuid = [guid]::NewGuid()
|
||||
|
||||
return $srmCmd
|
||||
}
|
||||
}
|
||||
|
||||
<# Internal function #>
|
||||
Function Add_Command {
|
||||
[cmdletbinding()]
|
||||
Param(
|
||||
[Parameter (Mandatory=$true, ValueFromPipeline=$true)][VMware.VimAutomation.Srm.Views.SrmRecoverySettings] $RecoverySettings,
|
||||
[Parameter (Mandatory=$true)][VMware.VimAutomation.Srm.Views.SrmCommand] $SrmCommand,
|
||||
[Parameter (Mandatory=$true)][bool] $PostRecovery
|
||||
)
|
||||
|
||||
if ($PostRecovery) {
|
||||
$commands = $RecoverySettings.PostPowerOnCallouts
|
||||
} else {
|
||||
$commands = $RecoverySettings.PrePowerOnCallouts
|
||||
}
|
||||
|
||||
if (-not $commands) {
|
||||
$commands = New-Object System.Collections.Generic.List[VMware.VimAutomation.Srm.Views.SrmCallout]
|
||||
}
|
||||
$commands.Add($SrmCommand)
|
||||
|
||||
if ($PostRecovery) {
|
||||
$RecoverySettings.PostPowerOnCallouts = $commands
|
||||
} else {
|
||||
$RecoverySettings.PrePowerOnCallouts = $commands
|
||||
}
|
||||
}
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Add an SRM command to the set of pre recovery callouts for a VM.
|
||||
|
||||
.PARAMETER RecoverySettings
|
||||
The recovery settings to update. These should have been retrieved via a
|
||||
call to Get-RecoverySettings
|
||||
|
||||
.PARAMETER SrmCommand
|
||||
The command to add to the list.
|
||||
|
||||
#>
|
||||
Function Add-PreRecoveryCommand {
|
||||
[cmdletbinding()]
|
||||
[OutputType([VMware.VimAutomation.Srm.Views.SrmRecoverySettings])]
|
||||
Param(
|
||||
[Parameter (Mandatory=$true, ValueFromPipeline=$true)][VMware.VimAutomation.Srm.Views.SrmRecoverySettings] $RecoverySettings,
|
||||
[Parameter (Mandatory=$true)][VMware.VimAutomation.Srm.Views.SrmCommand] $SrmCommand
|
||||
)
|
||||
Add_Command -RecoverySettings $RecoverySettings -SrmCommand $SrmCommand -PostRecovery $false
|
||||
return $RecoverySettings
|
||||
}
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Remove an SRM command from the set of pre recovery callouts for a VM.
|
||||
|
||||
.PARAMETER RecoverySettings
|
||||
The recovery settings to update. These should have been retrieved via a
|
||||
call to Get-RecoverySettings
|
||||
|
||||
.PARAMETER SrmCommand
|
||||
The command to remove from the list.
|
||||
|
||||
#>
|
||||
Function Remove-PreRecoveryCommand {
|
||||
[cmdletbinding(SupportsShouldProcess=$true, ConfirmImpact="Low")]
|
||||
[OutputType([VMware.VimAutomation.Srm.Views.SrmRecoverySettings])]
|
||||
Param(
|
||||
[Parameter (Mandatory=$true, ValueFromPipeline=$true)][VMware.VimAutomation.Srm.Views.SrmRecoverySettings] $RecoverySettings,
|
||||
[Parameter (Mandatory=$true)][VMware.VimAutomation.Srm.Views.SrmCommand] $SrmCommand
|
||||
)
|
||||
|
||||
if ($pscmdlet.ShouldProcess($SrmCommand.Description, "Remove")) {
|
||||
$RecoverySettings.PrePowerOnCallouts.Remove($SrmCommand)
|
||||
}
|
||||
|
||||
return $RecoverySettings
|
||||
}
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Add an SRM command to the set of post recovery callouts for a VM.
|
||||
|
||||
.PARAMETER RecoverySettings
|
||||
The recovery settings to update. These should have been retrieved via a
|
||||
call to Get-RecoverySettings
|
||||
|
||||
.PARAMETER SrmCommand
|
||||
The command to add to the list.
|
||||
|
||||
#>
|
||||
Function Add-PostRecoveryCommand {
|
||||
[cmdletbinding()]
|
||||
[OutputType([VMware.VimAutomation.Srm.Views.SrmRecoverySettings])]
|
||||
Param(
|
||||
[Parameter (Mandatory=$true, ValueFromPipeline=$true)][VMware.VimAutomation.Srm.Views.SrmRecoverySettings] $RecoverySettings,
|
||||
[Parameter (Mandatory=$true)][VMware.VimAutomation.Srm.Views.SrmCommand] $SrmCommand
|
||||
)
|
||||
|
||||
Add_Command -RecoverySettings $RecoverySettings -SrmCommand $SrmCommand -PostRecovery $true
|
||||
|
||||
return $RecoverySettings
|
||||
}
|
||||
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Remove an SRM command from the set of post recovery callouts for a VM.
|
||||
|
||||
.PARAMETER RecoverySettings
|
||||
The recovery settings to update. These should have been retrieved via a
|
||||
call to Get-RecoverySettings
|
||||
|
||||
.PARAMETER SrmCommand
|
||||
The command to remove from the list.
|
||||
|
||||
#>
|
||||
Function Remove-PostRecoveryCommand {
|
||||
[cmdletbinding(SupportsShouldProcess=$true, ConfirmImpact="Low")]
|
||||
[OutputType([VMware.VimAutomation.Srm.Views.SrmRecoverySettings])]
|
||||
Param(
|
||||
[Parameter (Mandatory=$true, ValueFromPipeline=$true)][VMware.VimAutomation.Srm.Views.SrmRecoverySettings] $RecoverySettings,
|
||||
[Parameter (Mandatory=$true)][VMware.VimAutomation.Srm.Views.SrmCommand] $SrmCommand
|
||||
)
|
||||
|
||||
if ($pscmdlet.ShouldProcess($SrmCommand.Description, "Remove")) {
|
||||
$RecoverySettings.PostPowerOnCallouts.Remove($SrmCommand)
|
||||
}
|
||||
|
||||
return $RecoverySettings
|
||||
}
|
||||
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Create a new recovery plan
|
||||
|
||||
.PARAMETER Name
|
||||
The name for this recovery plan
|
||||
|
||||
.PARAMETER Description
|
||||
A description of the recovery plan
|
||||
|
||||
.PARAMETER Folder
|
||||
The recovery plan folder in which to create this recovery plan. Will default to
|
||||
the root recovery plan folder
|
||||
|
||||
.PARAMETER ProtectionGroups
|
||||
The protection groups to associate with this recovery plan
|
||||
|
||||
.PARAMETER TestNetworkMappings
|
||||
The test network mappings to configure as part of this recovery plan
|
||||
|
||||
.PARAMETER SrmServer
|
||||
The SRM Server to operate against
|
||||
#>
|
||||
Function New-RecoveryPlan {
|
||||
[cmdletbinding(SupportsShouldProcess=$true, ConfirmImpact="Medium")]
|
||||
Param(
|
||||
[Parameter (Mandatory=$true)][string] $Name,
|
||||
[string] $Description,
|
||||
[VMware.VimAutomation.Srm.Views.SrmRecoveryPlanFolder] $Folder,
|
||||
[VMware.VimAutomation.Srm.Views.SrmProtectionGroup[]] $ProtectionGroups,
|
||||
[VMware.VimAutomation.Srm.Views.SrmRecoveryTestNetworkMapping[]] $TestNetworkMappings,
|
||||
[VMware.VimAutomation.Srm.Types.V1.SrmServer] $SrmServer
|
||||
)
|
||||
|
||||
$api = Get-ServerApiEndpoint -SrmServer $SrmServer
|
||||
|
||||
if (-not $Folder) {
|
||||
$Folder = Get-RecoveryPlanFolder -SrmServer $SrmServer
|
||||
}
|
||||
|
||||
$protectionGroupmRefs += @( $ProtectionGroups | ForEach-Object { $_.MoRef } | Select-Object -Unique)
|
||||
|
||||
[VMware.VimAutomation.Srm.Views.CreateRecoveryPlanTask] $task = $null
|
||||
|
||||
if ($PSCmdlet.ShouldProcess($Name, "New")) {
|
||||
$task = $api.Recovery.CreateRecoveryPlan(
|
||||
$Name,
|
||||
$Folder.MoRef,
|
||||
$protectionGroupmRefs,
|
||||
$Description,
|
||||
$TestNetworkMappings
|
||||
)
|
||||
}
|
||||
|
||||
while(-not $task.IsCreateRecoveryPlanComplete()) { Start-Sleep -Seconds 1 }
|
||||
|
||||
$task.GetNewRecoveryPlan()
|
||||
}
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Remove a recovery plan permanently
|
||||
|
||||
.PARAMETER RecoveryPlan
|
||||
The recovery plan to remove
|
||||
|
||||
.PARAMETER SrmServer
|
||||
The SRM Server to operate against
|
||||
#>
|
||||
Function Remove-RecoveryPlan {
|
||||
[cmdletbinding(SupportsShouldProcess=$True, ConfirmImpact="High")]
|
||||
Param(
|
||||
[Parameter (Mandatory=$true)][VMware.VimAutomation.Srm.Views.SrmRecoveryPlan] $RecoveryPlan,
|
||||
[VMware.VimAutomation.Srm.Types.V1.SrmServer] $SrmServer
|
||||
)
|
||||
|
||||
$api = Get-ServerApiEndpoint -SrmServer $SrmServer
|
||||
|
||||
$rpinfo = $RecoveryPlan.GetInfo()
|
||||
if ($pscmdlet.ShouldProcess($rpinfo.Name, "Remove")) {
|
||||
$api.Recovery.DeleteRecoveryPlan($RecoveryPlan.MoRef)
|
||||
}
|
||||
}
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Get a recovery plan folder
|
||||
|
||||
.PARAMETER SrmServer
|
||||
The SRM Server to query for the recovery plan folder
|
||||
#>
|
||||
Function Get-RecoveryPlanFolder {
|
||||
[cmdletbinding()]
|
||||
Param(
|
||||
[VMware.VimAutomation.Srm.Types.V1.SrmServer] $SrmServer
|
||||
)
|
||||
|
||||
$api = Get-ServerApiEndpoint -SrmServer $SrmServer
|
||||
|
||||
$folder = $api.Recovery.GetRecoveryPlanRootFolder()
|
||||
|
||||
return $folder
|
||||
}
|
||||
24
Modules/SRM/Meadowcroft.Srm.Storage.ps1
Normal file
24
Modules/SRM/Meadowcroft.Srm.Storage.ps1
Normal file
@@ -0,0 +1,24 @@
|
||||
# SRM Helper Methods - https://github.com/benmeadowcroft/SRM-Cmdlets
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Trigger Discover Devices for Site Recovery Manager
|
||||
|
||||
.OUTPUTS
|
||||
Returns discover devices task
|
||||
#>
|
||||
Function Start-DiscoverDevice {
|
||||
[cmdletbinding(SupportsShouldProcess=$True, ConfirmImpact="Medium")]
|
||||
[OutputType([VMware.VimAutomation.Srm.Views.DiscoverDevicesTask])]
|
||||
Param(
|
||||
[VMware.VimAutomation.Srm.Types.V1.SrmServer] $SrmServer
|
||||
)
|
||||
|
||||
$api = Get-ServerApiEndpoint -SrmServer $SrmServer
|
||||
$name = $SrmServer.Name
|
||||
[VMware.VimAutomation.Srm.Views.DiscoverDevicesTask] $task = $null
|
||||
if ($pscmdlet.ShouldProcess($name, "Rescan Storage Devices")) {
|
||||
$task = $api.Storage.DiscoverDevices()
|
||||
}
|
||||
return $task
|
||||
}
|
||||
92
Modules/SRM/Meadowcroft.Srm.psd1
Normal file
92
Modules/SRM/Meadowcroft.Srm.psd1
Normal file
@@ -0,0 +1,92 @@
|
||||
#
|
||||
# Module manifest for module 'Meadowcroft.Srm'
|
||||
#
|
||||
|
||||
@{
|
||||
|
||||
# Script module or binary module file associated with this manifest.
|
||||
RootModule = 'Meadowcroft.Srm.psm1'
|
||||
|
||||
# Version number of this module.
|
||||
ModuleVersion = '0.2'
|
||||
|
||||
# ID used to uniquely identify this module
|
||||
GUID = 'f9247009-9168-4a21-831b-819f82884ffe'
|
||||
|
||||
# Author of this module
|
||||
Author = 'Ben Meadowcroft'
|
||||
|
||||
# Company or vendor of this module
|
||||
CompanyName = 'VMware, Inc'
|
||||
|
||||
# Copyright statement for this module
|
||||
Copyright = '(c) 2014 - 2017. All rights reserved.'
|
||||
|
||||
# Description of the functionality provided by this module
|
||||
# Description = ''
|
||||
|
||||
# Minimum version of the Windows PowerShell engine required by this module
|
||||
# PowerShellVersion = ''
|
||||
|
||||
# Name of the Windows PowerShell host required by this module
|
||||
# PowerShellHostName = ''
|
||||
|
||||
# Minimum version of the Windows PowerShell host required by this module
|
||||
# PowerShellHostVersion = ''
|
||||
|
||||
# Minimum version of Microsoft .NET Framework required by this module
|
||||
# DotNetFrameworkVersion = ''
|
||||
|
||||
# Minimum version of the common language runtime (CLR) required by this module
|
||||
# CLRVersion = ''
|
||||
|
||||
# Processor architecture (None, X86, Amd64) required by this module
|
||||
# ProcessorArchitecture = ''
|
||||
|
||||
# Modules that must be imported into the global environment prior to importing this module
|
||||
RequiredModules = @{ModuleName='VMware.VimAutomation.Srm'; ModuleVersion='6.5'}
|
||||
|
||||
# Assemblies that must be loaded prior to importing this module
|
||||
# RequiredAssemblies = @()
|
||||
|
||||
# Script files (.ps1) that are run in the caller's environment prior to importing this module.
|
||||
# ScriptsToProcess = @()
|
||||
|
||||
# Type files (.ps1xml) to be loaded when importing this module
|
||||
# TypesToProcess = @()
|
||||
|
||||
# Format files (.ps1xml) to be loaded when importing this module
|
||||
# FormatsToProcess = @()
|
||||
|
||||
# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
|
||||
NestedModules = 'Meadowcroft.Srm.Recovery.ps1','Meadowcroft.Srm.Protection.ps1','Meadowcroft.Srm.Storage.ps1'
|
||||
# NestedModules = @()
|
||||
|
||||
# Functions to export from this module, note that internal functions use '_' not '-' as separator
|
||||
FunctionsToExport = '*-*'
|
||||
|
||||
# Cmdlets to export from this module
|
||||
CmdletsToExport = '*'
|
||||
|
||||
# Variables to export from this module
|
||||
VariablesToExport = '*'
|
||||
|
||||
# Aliases to export from this module
|
||||
AliasesToExport = '*'
|
||||
|
||||
# List of all modules packaged with this module
|
||||
# ModuleList = @()
|
||||
|
||||
# List of all files packaged with this module
|
||||
# FileList = @()
|
||||
|
||||
# Private data to pass to the module specified in RootModule/ModuleToProcess
|
||||
# PrivateData = ''
|
||||
|
||||
# HelpInfo URI of this module
|
||||
# HelpInfoURI = ''
|
||||
|
||||
# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
|
||||
DefaultCommandPrefix = 'Srm'
|
||||
|
||||
}
|
||||
148
Modules/SRM/Meadowcroft.Srm.psm1
Normal file
148
Modules/SRM/Meadowcroft.Srm.psm1
Normal file
@@ -0,0 +1,148 @@
|
||||
# SRM Helper Methods - https://github.com/benmeadowcroft/SRM-Cmdlets
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
This is intended to be an "internal" function only. It filters a
|
||||
pipelined input of objects and elimiates duplicates as identified
|
||||
by the MoRef property on the object.
|
||||
|
||||
.LINK
|
||||
https://github.com/benmeadowcroft/SRM-Cmdlets/
|
||||
#>
|
||||
Function Select_UniqueByMoRef {
|
||||
|
||||
Param(
|
||||
[Parameter (ValueFromPipeline=$true)] $in
|
||||
)
|
||||
process {
|
||||
$moref = New-Object System.Collections.ArrayList
|
||||
$in | Sort-Object | Select-Object MoRef -Unique | ForEach-Object { $moref.Add($_.MoRef) } > $null
|
||||
$in | ForEach-Object {
|
||||
if ($_.MoRef -in $moref) {
|
||||
$moref.Remove($_.MoRef)
|
||||
$_ #output
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
This is intended to be an "internal" function only. It gets the
|
||||
MoRef property of a VM from either a VM object, a VM view, or the
|
||||
protected VM object.
|
||||
#>
|
||||
Function Get_MoRefFromVmObj {
|
||||
Param(
|
||||
[Parameter (ValueFromPipeline=$true)][VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine] $Vm,
|
||||
[Parameter (ValueFromPipeline=$true)][VMware.Vim.VirtualMachine] $VmView,
|
||||
[Parameter (ValueFromPipeline=$true)][VMware.VimAutomation.Srm.Views.SrmProtectionGroupProtectedVm] $ProtectedVm
|
||||
)
|
||||
|
||||
|
||||
$moRef = $null
|
||||
if ($Vm.ExtensionData.MoRef) { # VM object
|
||||
$moRef = $Vm.ExtensionData.MoRef
|
||||
} elseif ($VmView.MoRef) { # VM view
|
||||
$moRef = $VmView.MoRef
|
||||
} elseif ($protectedVm) {
|
||||
$moRef = $ProtectedVm.Vm.MoRef
|
||||
}
|
||||
|
||||
$moRef
|
||||
}
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Lookup the srm instance for a specific server.
|
||||
#>
|
||||
Function Get-Server {
|
||||
[cmdletbinding()]
|
||||
Param(
|
||||
[string] $SrmServerAddress,
|
||||
[VMware.VimAutomation.Srm.Types.V1.SrmServer] $SrmServer
|
||||
)
|
||||
|
||||
$found = $null
|
||||
|
||||
if ($SrmServer) {
|
||||
$found = $SrmServer
|
||||
} elseif ($SrmServerAddress) {
|
||||
# search for server address in default servers
|
||||
$global:DefaultSrmServers | ForEach-Object {
|
||||
if ($_.Name -ieq $SrmServerAddress) {
|
||||
$found = $_
|
||||
}
|
||||
}
|
||||
if (-not $found) {
|
||||
throw "SRM server $SrmServerAddress not found. Connect-Server must be called first."
|
||||
}
|
||||
}
|
||||
|
||||
if (-not $found) {
|
||||
#default result
|
||||
$found = $global:DefaultSrmServers[0]
|
||||
}
|
||||
|
||||
return $found;
|
||||
}
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Retrieve the SRM Server Version
|
||||
#>
|
||||
Function Get-ServerVersion {
|
||||
[cmdletbinding()]
|
||||
Param(
|
||||
[VMware.VimAutomation.Srm.Types.V1.SrmServer] $SrmServer
|
||||
)
|
||||
$srm = Get-Server $SrmServer
|
||||
$srm.Version
|
||||
}
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Lookup the SRM API endpoint for a specific server.
|
||||
#>
|
||||
Function Get-ServerApiEndpoint {
|
||||
[cmdletbinding()]
|
||||
Param(
|
||||
[string] $SrmServerAddress,
|
||||
[VMware.VimAutomation.Srm.Types.V1.SrmServer] $SrmServer
|
||||
)
|
||||
|
||||
[VMware.VimAutomation.Srm.Types.V1.SrmServer] $server = Get-Server -SrmServerAddress $SrmServerAddress -SrmServer $SrmServer
|
||||
|
||||
return $server.ExtensionData
|
||||
}
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Get the placeholder VMs that are associated with SRM
|
||||
#>
|
||||
Function Get-PlaceholderVM {
|
||||
[cmdletbinding()]
|
||||
Param()
|
||||
Get-VM @Args | Where-Object {$_.ExtensionData.Config.ManagedBy.extensionKey -like "com.vmware.vcDr*" -and $_.ExtensionData.Config.ManagedBy.Type -ieq 'placeholderVm'}
|
||||
}
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Get the test VMs that are associated with SRM
|
||||
#>
|
||||
Function Get-TestVM {
|
||||
[cmdletbinding()]
|
||||
Param()
|
||||
Get-VM @Args | Where-Object {$_.ExtensionData.Config.ManagedBy.extensionKey -like "com.vmware.vcDr*" -and $_.ExtensionData.Config.ManagedBy.Type -ieq 'testVm'}
|
||||
}
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Get the VMs that are replicated using vSphere Replication. These may not be SRM
|
||||
protected VMs.
|
||||
#>
|
||||
Function Get-ReplicatedVM {
|
||||
[cmdletbinding()]
|
||||
Param()
|
||||
Get-VM @Args | Where-Object {($_.ExtensionData.Config.ExtraConfig | Where-Object { $_.Key -eq 'hbr_filter.destination' -and $_.Value } )}
|
||||
}
|
||||
7
Modules/SRM/NOTICE.txt
Normal file
7
Modules/SRM/NOTICE.txt
Normal file
@@ -0,0 +1,7 @@
|
||||
|
||||
Copyright (c) 2017 VMware, Inc. All Rights Reserved.
|
||||
|
||||
This product is licensed to you under the Apache License version 2.0 (the "License"). You may not use this product except in compliance with the License.
|
||||
|
||||
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.
|
||||
|
||||
81
Modules/SRM/README.md
Normal file
81
Modules/SRM/README.md
Normal file
@@ -0,0 +1,81 @@
|
||||
# SRM PowerCLI Cmdlets
|
||||
|
||||
Helper functions for working with VMware SRM 6.5 with PowerCLI 6.5.1 or later. PowerShell 5.0 and above is required.
|
||||
|
||||
This module is provided for illustrative/educational purposes to explain how the PowerCLI access to the SRM public API can be used.
|
||||
|
||||
## Getting Started
|
||||
|
||||
### Getting the SRM cmdlets
|
||||
|
||||
The latest version of the software can be cloned from the git repository:
|
||||
|
||||
git clone https://github.com/benmeadowcroft/SRM-Cmdlets.git
|
||||
|
||||
Or downloaded as a [zip file](https://github.com/benmeadowcroft/SRM-Cmdlets/archive/master.zip).
|
||||
|
||||
Specific releases (compatible with earlier PowerCLI and SRM versions) can be downloaded via the [release page](https://github.com/benmeadowcroft/SRM-Cmdlets/releases).
|
||||
|
||||
### Deploy SRM-Cmdlets module
|
||||
|
||||
After cloning (or downloading and extracting) the PowerShell module, you can import the module into your current PowerShell session by by passing the path to `Meadowcroft.Srm.psd1` to the `Import-Module` cmdlet, e.g.:
|
||||
|
||||
Import-Module -Name .\SRM-Cmdlets\Meadowcroft.Srm.psd1
|
||||
|
||||
You can also install the module into the PowerShell path so it can be loaded implicitly. See [Microsoft's Installing Modules instructions](http://msdn.microsoft.com/en-us/library/dd878350) for more details on how to do this.
|
||||
|
||||
The module uses the default prefix of `Srm` for the custom functions it defines. This can be overridden when importing the module by setting the value of the `-Prefix` parameter when calling `Import-Module`.
|
||||
|
||||
### Connecting to SRM
|
||||
|
||||
After installing the module the next step is to connect to the SRM server. Details of how to do this are located in the [PowerCLI 6.5.1 User's Guide](http://pubs.vmware.com/vsphere-65/topic/com.vmware.powercli.ug.doc/GUID-A5F206CF-264D-4565-8CB9-4ED1C337053F.html)
|
||||
|
||||
$credential = Get-Credential
|
||||
Connect-VIServer -Server vc-a.example.com -Credential $credential
|
||||
Connect-SrmServer -Credential $credential -RemoteCredential $credential
|
||||
|
||||
At this point we've just been using the cmdlets provided by PowerCLI, the PowerCLI documentation also provides some examples of how to call the SRM API to perform various tasks. In the rest of this introduction we'll perform some of those tasks using the custom functions defined in this project.
|
||||
|
||||
### Report the Protected Virtual Machines and Their Protection Groups
|
||||
|
||||
Goal: Create a simple report listing the VMs protected by SRM and the protection group they belong to.
|
||||
|
||||
Get-SrmProtectionGroup | %{
|
||||
$pg = $_
|
||||
Get-SrmProtectedVM -ProtectionGroup $pg } | %{
|
||||
$output = "" | select VmName, PgName
|
||||
$output.VmName = $_.Vm.Name
|
||||
$output.PgName = $pg.GetInfo().Name
|
||||
$output
|
||||
} | Format-Table @{Label="VM Name"; Expression={$_.VmName} },
|
||||
@{Label="Protection group name"; Expression={$_.PgName}
|
||||
}
|
||||
|
||||
### Report the Last Recovery Plan Test
|
||||
|
||||
Goal: Create a simple report listing the state of the last test of a recovery plan
|
||||
|
||||
Get-SrmRecoveryPlan | %{ $_ |
|
||||
Get-SrmRecoveryPlanResult -RecoveryMode Test | select -First 1
|
||||
} | Select Name, StartTime, RunMode, ResultState | Format-Table
|
||||
|
||||
|
||||
### Execute a Recovery Plan Test
|
||||
|
||||
Goal: for a specific recovery plan, execute a test failover. Note the "local" SRM server we are connected to should be the recovery site in order for this to be successful.
|
||||
|
||||
Get-SrmRecoveryPlan -Name "Name of Plan" | Start-SrmRecoveryPlan -RecoveryMode Test
|
||||
|
||||
### Export the Detailed XML Report of the Last Recovery Plan Workflow
|
||||
|
||||
Goal: get the XML report of the last recovery plan execution for a specific recovery plan.
|
||||
|
||||
Get-SrmRecoveryPlan -Name "Name of Plan" | Get-SrmRecoveryPlanResult |
|
||||
select -First 1 | Export-SrmRecoveryPlanResultAsXml
|
||||
|
||||
### Protect a Replicated VM
|
||||
|
||||
Goal: Take a VM replicated using vSphere Replication or Array Based Replication, add it to an appropriate protection group and configure it for protection
|
||||
|
||||
$pg = Get-SrmProtectionGroup "Name of Protection Group"
|
||||
Get-VM vm-01a | Protect-SrmVM -ProtectionGroup $pg
|
||||
68
Modules/VCSA/VCSA.psm1
Normal file
68
Modules/VCSA/VCSA.psm1
Normal file
@@ -0,0 +1,68 @@
|
||||
Function Get-VCSAPasswordPolicy {
|
||||
<#
|
||||
.DESCRIPTION Retrieves vCenter Server Appliance SSO and Local OS Password Policy Configuration
|
||||
.NOTES Author: William Lam
|
||||
.PARAMETER VCSAName
|
||||
Inventory name of the VCSA VM
|
||||
.PARAMETER VCSARootPassword
|
||||
Root password for VCSA VM
|
||||
.PARAMETER SSODomain
|
||||
SSO Domain of the VCSA VM
|
||||
.PARAMETER SSOPassword
|
||||
Administrator password for the SSO Domain of the VCSA VM
|
||||
.EXAMPLE
|
||||
Get-VCSAPasswordPolicy -VCSAName "MGMT-VCSA-01" -VCSARootPassword "VMware1!" -SSODomain "vsphere.local" -SSOPassword "VMware1!"
|
||||
#>
|
||||
Param (
|
||||
[Parameter(Mandatory=$true)][String]$VCSAName,
|
||||
[Parameter(Mandatory=$true)][String]$VCSARootPassword,
|
||||
[Parameter(Mandatory=$true)][String]$SSODomain,
|
||||
[Parameter(Mandatory=$true)][String]$SSOPassword
|
||||
)
|
||||
|
||||
$vm = Get-Vm -Name $VCSAName
|
||||
|
||||
if($vm) {
|
||||
$a,$b = $SSODomain.split(".")
|
||||
|
||||
$ssoPasswordPolicy = Invoke-VMScript -ScriptText "/opt/likewise/bin/ldapsearch -h localhost -w $SSOPassword -x -D `"cn=Administrator,cn=Users,dc=$a,dc=$b`" -b `"cn=password and lockout policy,dc=$a,dc=$b`" | grep vmwPassword" -vm $vm -GuestUser "root" -GuestPassword $VCSARootPassword
|
||||
$localOSPasswordPolicy = Invoke-VMScript -ScriptText "cat /etc/login.defs | grep -v '#' | grep PASS" -vm $vm -GuestUser "root" -GuestPassword $VCSARootPassword
|
||||
|
||||
Write-Host -ForegroundColor green "`nSSO Password Policy: "
|
||||
$ssoPasswordPolicy
|
||||
|
||||
Write-Host -ForegroundColor green "`nLocalOS Password Policy: "
|
||||
$localOSPasswordPolicy
|
||||
} else {
|
||||
Write-Host "`nUnable to find VCSA named $VCSAName"
|
||||
}
|
||||
}
|
||||
|
||||
Function Get-VCSAIdentitySource {
|
||||
<#
|
||||
.DESCRIPTION Retrieves vCenter Server Appliance Identity Source Configuration
|
||||
.NOTES Author: William Lam
|
||||
.PARAMETER VCSAName
|
||||
Inventory name of the VCSA VM
|
||||
.PARAMETER VCSARootPassword
|
||||
Root password for VCSA VM
|
||||
.EXAMPLE
|
||||
Get-VCSAIdentitySource -VCSAName "MGMT-VCSA-01" -VCSARootPassword "VMware1!"
|
||||
#>
|
||||
Param (
|
||||
[Parameter(Mandatory=$true)][String]$VCSAName,
|
||||
[Parameter(Mandatory=$true)][String]$VCSARootPassword
|
||||
)
|
||||
|
||||
$vm = Get-Vm -Name $VCSAName
|
||||
|
||||
if($vm) {
|
||||
$identitySources = Invoke-VMScript -ScriptText "/opt/vmware/bin/sso-config.sh -get_identity_sources 2> /dev/null | sed -ne '/^*/,$ p'" -vm $vm -GuestUser "root" -GuestPassword $VCSARootPassword
|
||||
|
||||
Write-Host -ForegroundColor green "`nIdentity Sources: "
|
||||
$identitySources
|
||||
|
||||
} else {
|
||||
Write-Host "`nUnable to find VCSA named $VCSAName"
|
||||
}
|
||||
}
|
||||
@@ -112,7 +112,7 @@ function Get-VmfsDatastoreIncrease
|
||||
Datastore = $Datastore.Name
|
||||
CanonicalName = $disk.CanonicalName
|
||||
Model = "$($disk.Vendor.TrimEnd(' ')).$($disk.Model.TrimEnd(' ')).$($disk.Revision.TrimEnd(' '))"
|
||||
DiskSizeGB = $partInfo[0].Layout.Total.BlockSize * $hdPartInfo[0].Layout.Total.Block / 1GB
|
||||
DiskSizeGB = $partInfo[0].Layout.Total.BlockSize * $partInfo[0].Layout.Total.Block / 1GB
|
||||
DiskBlocks = $partInfo[0].Layout.Total.Block
|
||||
DiskBlockMB = $partInfo[0].Layout.Total.BlockSize/1MB
|
||||
AvailableGB = [math]::Round($partMax - $partUsed, 2)
|
||||
@@ -181,7 +181,7 @@ function New-VmfsDatastoreIncrease
|
||||
{
|
||||
$lun = $hScsiDisk | where{ $_.CanonicalName -eq $dsOpt.Spec.Extent.DiskName }
|
||||
$partInfo = $hsSys.RetrieveDiskPartitionInfo($lun.DeviceName)
|
||||
$partMax = ($vmfsExpOpt[0].Info.Layout.Partition | where{ $_.Type -eq 'VMFS' } | %{ ($_.End.Block - $_.Start.Block + 1) * $_.Start.BlockSize } |
|
||||
$partMax = ($expOpt[0].Info.Layout.Partition | where{ $_.Type -eq 'VMFS' } | %{ ($_.End.Block - $_.Start.Block + 1) * $_.Start.BlockSize } |
|
||||
Measure-Object -Sum | select -ExpandProperty Sum)/1GB
|
||||
$partUsed = ($partInfo[0].Layout.Partition | where{ $_.Type -eq 'VMFS' } | %{ ($_.End.Block - $_.Start.Block + 1) * $_.Start.BlockSize } |
|
||||
Measure-Object -Sum | select -ExpandProperty Sum)/1GB
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Script Module : VMToolsManagement
|
||||
# Script Module : VMToolsManagement
|
||||
# Version : 1.0
|
||||
|
||||
# Copyright © 2017 VMware, Inc. All Rights Reserved.
|
||||
@@ -37,10 +37,10 @@ New-VIProperty -Name ToolsBuildNumber -Object VirtualMachine -Value {
|
||||
Function Get-VMToolsInfo {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
This cmdlet retrieves the VMTools info of specified virtual machines.
|
||||
This advanced function retrieves the VMTools info of specified virtual machines.
|
||||
|
||||
.DESCRIPTION
|
||||
This cmdlet retrieves the VMTools version and build number info of specified virtual machines.
|
||||
This advanced function retrieves the VMTools version and build number info of specified virtual machines.
|
||||
|
||||
.PARAMETER VM
|
||||
Specifies the virtual machines which you want to get the VMTools info of.
|
||||
@@ -50,7 +50,7 @@ Function Get-VMToolsInfo {
|
||||
C:\PS> $VCServer = Connect-VIServer -Server <vCenter Server IP> -User <vCenter User> -Password <vCenter Password>
|
||||
C:\PS> Get-VM -Server $VCServer | Get-VMToolsInfo
|
||||
|
||||
Retrieves VMTools info of all virtual machines which run in the $VCServer vCetner Server.
|
||||
Retrieves VMTools info of all virtual machines which run in the $VCServer vCenter Server.
|
||||
|
||||
.EXAMPLE
|
||||
C:\PS> Get-VM "*rhel*" | Get-VMToolsInfo
|
||||
@@ -74,7 +74,7 @@ Function Get-VMToolsInfo {
|
||||
Retrieves VMTools info of virtual machines which run on the "MyESXiHostName" ESXi host.
|
||||
|
||||
.NOTES
|
||||
This cmdlet assumes that you are connected to at least one vCenter Server system.
|
||||
This advanced function assumes that you are connected to at least one vCenter Server system.
|
||||
The tools build number is not supported in VMTools before 10.2.0
|
||||
|
||||
.NOTES
|
||||
@@ -100,17 +100,17 @@ Function Get-VMToolsInfo {
|
||||
)
|
||||
|
||||
Process {
|
||||
Get-VM $VM | Select Name, @{Name="ToolsVersion"; Expression={$_.Guest.ToolsVersion}}, ToolsBuildNumber
|
||||
Get-VM $VM | Select-Object Name, @{Name="ToolsVersion"; Expression={$_.Guest.ToolsVersion}}, ToolsBuildNumber
|
||||
}
|
||||
}
|
||||
|
||||
Function Get-VMToolsInstallLastError {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
This cmdlet retrieves the error code of last VMTools installation.
|
||||
This advanced function retrieves the error code of last VMTools installation.
|
||||
|
||||
.DESCRIPTION
|
||||
This cmdlet retrieves the error code of last VMTools installation on specified virtual machines.
|
||||
This advanced function retrieves the error code of last VMTools installation on specified virtual machines.
|
||||
|
||||
.PARAMETER VM
|
||||
Specifies the virtual machines which you want to get the error code of.
|
||||
@@ -120,7 +120,7 @@ Function Get-VMToolsInstallLastError {
|
||||
C:\PS> $VCServer = Connect-VIServer -Server <vCenter Server IP> -User <vCenter User> -Password <vCenter Password>
|
||||
C:\PS> Get-VM -Server $VCServer | Get-VMToolsInstallLastError
|
||||
|
||||
Retrieves the last VMTools installation error code of all virtual machines which run in the $VCServer vCetner Server.
|
||||
Retrieves the last VMTools installation error code of all virtual machines which run in the $VCServer vCenter Server.
|
||||
|
||||
.EXAMPLE
|
||||
C:\PS> Get-VM "*win*" | Get-VMToolsInstallLastError
|
||||
@@ -144,7 +144,7 @@ Function Get-VMToolsInstallLastError {
|
||||
Retrieves the last VMTools installation error code of virtual machines which run on the "MyESXiHostName" ESXi host.
|
||||
|
||||
.NOTES
|
||||
This cmdlet assumes that you are connected to at least one vCenter Server system.
|
||||
This advanced function assumes that you are connected to at least one vCenter Server system.
|
||||
|
||||
.NOTES
|
||||
Author : Daoyuan Wang
|
||||
@@ -171,7 +171,7 @@ Function Get-VMToolsInstallLastError {
|
||||
Process {
|
||||
$result = @()
|
||||
foreach ($_ in $VM) {
|
||||
$errorCodeInfo = $_.ExtensionData.Config.ExtraConfig.GetEnumerator() | where {$_.Key -eq "guestinfo.toolsInstallErrCode"}
|
||||
$errorCodeInfo = $_.ExtensionData.Config.ExtraConfig.GetEnumerator() | Where-Object {$_.Key -eq "guestinfo.toolsInstallErrCode"}
|
||||
|
||||
$info = New-Object PSObject
|
||||
$info | Add-Member -type NoteProperty -name VmName -value $_.Name
|
||||
@@ -186,10 +186,10 @@ Function Get-VMToolsInstallLastError {
|
||||
Function Get-VMToolsGuestInfo {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
This cmdlet retrieves the guest info of specified virtual machines.
|
||||
This advanced function retrieves the guest info of specified virtual machines.
|
||||
|
||||
.DESCRIPTION
|
||||
This cmdlet retrieves the guest info such as HostName, IP, ToolsStatus, ToolsVersion,
|
||||
This advanced function retrieves the guest info such as HostName, IP, ToolsStatus, ToolsVersion,
|
||||
ToolsInstallType and GuestFamily of specified virtual machines.
|
||||
|
||||
.PARAMETER VM
|
||||
@@ -200,7 +200,7 @@ Function Get-VMToolsGuestInfo {
|
||||
C:\PS> $VCServer = Connect-VIServer -Server <vCenter Server IP> -User <vCenter User> -Password <vCenter Password>
|
||||
C:\PS> Get-VM -Server $VCServer | Get-VMToolsGuestInfo
|
||||
|
||||
Retrieves guest info of all virtual machines which run in the $VCServer vCetner Server.
|
||||
Retrieves guest info of all virtual machines which run in the $VCServer vCenter Server.
|
||||
|
||||
.EXAMPLE
|
||||
C:\PS> Get-VM "*win*" | Get-VMToolsGuestInfo
|
||||
@@ -236,7 +236,7 @@ Function Get-VMToolsGuestInfo {
|
||||
Retrieves guest info of virtual machines which run on the "MyESXiHostName" ESXi host.
|
||||
|
||||
.NOTES
|
||||
This cmdlet assumes that you are connected to at least one vCenter Server system.
|
||||
This advanced function assumes that you are connected to at least one vCenter Server system.
|
||||
|
||||
.NOTES
|
||||
Author : Daoyuan Wang
|
||||
@@ -261,7 +261,7 @@ Function Get-VMToolsGuestInfo {
|
||||
)
|
||||
|
||||
Process {
|
||||
Get-VM $VM | Select Name, @{Name="HostName"; Expression={$_.Guest.HostName}},
|
||||
Get-VM $VM | Select-Object Name, @{Name="HostName"; Expression={$_.Guest.HostName}},
|
||||
@{Name="IP"; Expression={$_.Guest.ExtensionData.IpAddress}},
|
||||
@{Name="ToolsStatus"; Expression={$_.Guest.ExtensionData.ToolsStatus}},
|
||||
@{Name="ToolsVersion"; Expression={$_.Guest.ToolsVersion}},
|
||||
@@ -274,10 +274,10 @@ Function Get-VMToolsGuestInfo {
|
||||
Function Get-VMByToolsInfo {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
This cmdlet retrieves the virtual machines with specified VMTools info.
|
||||
This advanced function retrieves the virtual machines with specified VMTools info.
|
||||
|
||||
.DESCRIPTION
|
||||
This cmdlet retrieves the virtual machines with specified VMTools version,
|
||||
This advanced function retrieves the virtual machines with specified VMTools version,
|
||||
running status or version status.
|
||||
|
||||
.PARAMETER VM
|
||||
@@ -297,7 +297,7 @@ Function Get-VMByToolsInfo {
|
||||
C:\PS> $VCServer = Connect-VIServer -Server <vCenter Server IP> -User <vCenter User> -Password <vCenter Password>
|
||||
C:\PS> Get-VM -Server $VCServer | Get-VMByToolsInfo
|
||||
|
||||
Retrieves the virtual machines with VMTools not running in vCetner Server $VCServer.
|
||||
Retrieves the virtual machines with VMTools not running in vCenter Server $VCServer.
|
||||
|
||||
.EXAMPLE
|
||||
C:\PS> Get-VM | Get-VMByToolsInfo -ToolsRunningStatus guestToolsNotRunning
|
||||
@@ -328,7 +328,7 @@ Function Get-VMByToolsInfo {
|
||||
Retrieves the virtual machines with VMTools that need to upgrade on the "MyESXiHostName" ESXi host.
|
||||
|
||||
.NOTES
|
||||
This cmdlet assumes that you are connected to at least one vCenter Server system.
|
||||
This advanced function assumes that you are connected to at least one vCenter Server system.
|
||||
|
||||
.NOTES
|
||||
Author : Daoyuan Wang
|
||||
@@ -361,9 +361,9 @@ Function Get-VMByToolsInfo {
|
||||
[String] $ToolsRunningStatus,
|
||||
|
||||
[Parameter(Mandatory=$false)]
|
||||
[ValidateSet("guestToolsNotInstalled",
|
||||
"guestToolsNeedUpgrade",
|
||||
"guestToolsCurrent",
|
||||
[ValidateSet("guestToolsNotInstalled",
|
||||
"guestToolsNeedUpgrade",
|
||||
"guestToolsCurrent",
|
||||
"guestToolsUnmanaged")]
|
||||
[String] $ToolsVersionStatus
|
||||
)
|
||||
@@ -376,65 +376,60 @@ Function Get-VMByToolsInfo {
|
||||
}
|
||||
|
||||
if ($ToolsVersion) {
|
||||
$vmList = $vmList | Where {$_.Guest.ToolsVersion -like $ToolsVersion}
|
||||
$vmList = $vmList | Where-Object {$_.Guest.ToolsVersion -like $ToolsVersion}
|
||||
}
|
||||
|
||||
if ($ToolsRunningStatus) {
|
||||
$vmList = $vmList | Where {$_.Guest.ExtensionData.ToolsRunningStatus -eq $ToolsRunningStatus}
|
||||
$vmList = $vmList | Where-Object {$_.Guest.ExtensionData.ToolsRunningStatus -eq $ToolsRunningStatus}
|
||||
}
|
||||
|
||||
if ($ToolsVersionStatus) {
|
||||
$vmList = $vmList | Where {$_.Guest.ExtensionData.ToolsVersionStatus -eq $ToolsVersionStatus}
|
||||
$vmList = $vmList | Where-Object {$_.Guest.ExtensionData.ToolsVersionStatus -eq $ToolsVersionStatus}
|
||||
}
|
||||
|
||||
$vmList
|
||||
}
|
||||
}
|
||||
|
||||
Function Set-VMToolsUpgradePolicy {
|
||||
Function Get-VMToolsUpgradePolicy {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
This cmdlet sets the VMTool's upgrade policy to "upgradeAtPowerCycle".
|
||||
This advanced function retrieves the VMTools upgrade policy info of specified virtual machines.
|
||||
|
||||
.DESCRIPTION
|
||||
This cmdlet sets the VMTool's upgrade policy to "upgradeAtPowerCycle" of specified virtual machines.
|
||||
This advanced function retrieves the VMTools upgrade policy info of specified virtual machines.
|
||||
|
||||
.PARAMETER VM
|
||||
Specifies the virtual machines which you want to set the VMTool's upgrade policy of.
|
||||
Specifies the virtual machines which you want to query VMTools status of.
|
||||
|
||||
.EXAMPLE
|
||||
C:\PS> Import-Module .\VMToolsManagement.psm1
|
||||
C:\PS> $VCServer = Connect-VIServer -Server <vCenter Server IP> -User <vCenter User> -Password <vCenter Password>
|
||||
C:\PS> Get-VM -Server $VCServer | Set-VMToolsUpgradePolicy
|
||||
|
||||
Sets VMTool's upgrade policy to "upgradeAtPowerCycle" of all virtual machines in the $VCServer vCetner Server.
|
||||
C:\PS> Get-VM "*rhel*" | Get-VMToolsUpgradePolicy
|
||||
Name VMToolsUpgradePolicy
|
||||
------ ----------------------
|
||||
111394-RHEL-6.8-0 manual
|
||||
111394-RHEL-6.8-1 manual
|
||||
111393-RHEL-Server-7.2 upgradeAtPowerCycle
|
||||
Retrieves VMTools upgrade policy info of virtual machines with name containing "rhel".
|
||||
|
||||
.EXAMPLE
|
||||
C:\PS> Get-VM "*win*" | Set-VMToolsUpgradePolicy
|
||||
|
||||
Sets VMTool's upgrade policy to "upgradeAtPowerCycle" of virtual machines with name containing "win".
|
||||
C:\PS> Get-VM -Location "MyClusterName" | Get-VMToolsUpgradePolicy
|
||||
Retrieves VMTools upgrade policy info from virtual machines which run in the "MyClusterName" cluster.
|
||||
|
||||
.EXAMPLE
|
||||
C:\PS> Get-VM -Location "MyClusterName" | Set-VMToolsUpgradePolicy
|
||||
|
||||
Sets VMTool's upgrade policy to "upgradeAtPowerCycle" of virtual machines in the "MyClusterName" cluster.
|
||||
|
||||
.EXAMPLE
|
||||
C:\PS> Get-VMHost "MyESXiHostName" | Get-VM | Set-VMToolsUpgradePolicy
|
||||
|
||||
Sets VMTool's upgrade policy to "upgradeAtPowerCycle" of virtual machines on the "MyESXiHostName" ESXi host.
|
||||
C:\PS> Get-VMHost "MyESXiHostName" | Get-VM | Get-VMToolsUpgradePolicy
|
||||
Retrieves VMTools upgrade policyinfo of virtual machines which run on the "MyESXiHostName" ESXi host.
|
||||
|
||||
.NOTES
|
||||
This cmdlet assumes that you are connected to at least one vCenter Server system.
|
||||
This advanced function assumes that you are connected to at least one vCenter Server system.
|
||||
|
||||
.NOTES
|
||||
Author : Daoyuan Wang
|
||||
Author email : daoyuanw@vmware.com
|
||||
Author : Kyle Ruddy
|
||||
Author email : kmruddy@gmail.com
|
||||
Version : 1.0
|
||||
==========Tested Against Environment==========
|
||||
VMware vSphere Hypervisor(ESXi) Version : 6.5 (build 4564106)
|
||||
VMware vCenter Server Version : 6.5 (build 4602587)
|
||||
PowerCLI Version : PowerCLI 6.5 (build 4624819)
|
||||
VMware vSphere Hypervisor(ESXi) Version : 6.5 (build 7388607)
|
||||
VMware vCenter Server Version : 6.5 (build 7312210)
|
||||
PowerCLI Version : PowerCLI 6.5 (build 7155375)
|
||||
PowerShell Version : 5.1
|
||||
#>
|
||||
|
||||
@@ -448,8 +443,81 @@ Function Set-VMToolsUpgradePolicy {
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine[]] $VM
|
||||
)
|
||||
|
||||
Process {
|
||||
|
||||
Get-VM $VM | Select-Object Name, @{Name="VMToolsUpgradePolicy"; Expression={$_.ExtensionData.Config.Tools.ToolsUpgradePolicy}}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Function Set-VMToolsUpgradePolicy {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
This advanced function sets the VMTool's upgrade policy to either "manual" or "upgradeAtPowerCycle".
|
||||
|
||||
.DESCRIPTION
|
||||
This advanced function sets the VMTool's upgrade policy to either "manual" or "upgradeAtPowerCycle" of specified virtual machines.
|
||||
|
||||
.PARAMETER VM
|
||||
Specifies the virtual machines which you want to set the VMTool's upgrade policy of.
|
||||
|
||||
.EXAMPLE
|
||||
C:\PS> Import-Module .\VMToolsManagement.psm1
|
||||
C:\PS> $VCServer = Connect-VIServer -Server <vCenter Server IP> -User <vCenter User> -Password <vCenter Password>
|
||||
C:\PS> Get-VM -Server $VCServer | Set-VMToolsUpgradePolicy -UpgradePolicy manual
|
||||
|
||||
Sets VMTool's upgrade policy to "manual" of all virtual machines in the $VCServer vCenter Server.
|
||||
|
||||
.EXAMPLE
|
||||
C:\PS> Get-VM "*win*" | Set-VMToolsUpgradePolicy -UpgradePolicy upgradeAtPowerCycle
|
||||
|
||||
Sets VMTool's upgrade policy to "upgradeAtPowerCycle" of virtual machines with name containing "win".
|
||||
|
||||
.EXAMPLE
|
||||
C:\PS> Get-VM -Location "MyClusterName" | Set-VMToolsUpgradePolicy -UpgradePolicy upgradeAtPowerCycle
|
||||
|
||||
Sets VMTool's upgrade policy to "upgradeAtPowerCycle" of virtual machines in the "MyClusterName" cluster.
|
||||
|
||||
.EXAMPLE
|
||||
C:\PS> Get-VMHost "MyESXiHostName" | Get-VM | Set-VMToolsUpgradePolicy -UpgradePolicy manual
|
||||
|
||||
Sets VMTool's upgrade policy to "manual" of virtual machines on the "MyESXiHostName" ESXi host.
|
||||
|
||||
.NOTES
|
||||
This advanced function assumes that you are connected to at least one vCenter Server system.
|
||||
|
||||
.NOTES
|
||||
Author : Daoyuan Wang
|
||||
Author email : daoyuanw@vmware.com
|
||||
Version : 1.1
|
||||
Update Author : Kyle Ruddy
|
||||
Update email : kmruddy@gmail.com
|
||||
==========Tested Against Environment==========
|
||||
VMware vSphere Hypervisor(ESXi) Version : 6.5 (build 4564106)(build 7388607)
|
||||
VMware vCenter Server Version : 6.5 (build 4602587)(build 7312210)
|
||||
PowerCLI Version : PowerCLI 6.5 (build 4624819)(build 7155375)
|
||||
PowerShell Version : 5.1
|
||||
#>
|
||||
|
||||
[CmdletBinding(SupportsShouldProcess)]
|
||||
|
||||
Param (
|
||||
[Parameter(Mandatory=$true,
|
||||
ValueFromPipeLine = $true,
|
||||
ValueFromPipelinebyPropertyName=$True,
|
||||
Position = 0)]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine[]] $VM,
|
||||
|
||||
[Parameter(Mandatory=$false,
|
||||
Position = 1)]
|
||||
[ValidateSet("upgradeAtPowerCycle",
|
||||
"manual")]
|
||||
[String] $UpgradePolicy
|
||||
)
|
||||
Begin {
|
||||
$UpgradePolicy = "upgradeAtPowerCycle"
|
||||
$vmConfigSpec = New-Object VMware.Vim.VirtualMachineConfigSpec
|
||||
$vmConfigSpec.Tools = New-Object VMware.Vim.ToolsConfigInfo
|
||||
$vmConfigSpec.Tools.ToolsUpgradePolicy = $UpgradePolicy
|
||||
@@ -463,6 +531,7 @@ Function Set-VMToolsUpgradePolicy {
|
||||
if ($vmView.Config.Tools.ToolsUpgradePolicy -ne $UpgradePolicy) {
|
||||
Write-Verbose "Applying 'upgradeAtPowerCycle' setting to $($_.Name)..."
|
||||
$vmView.ReconfigVM($vmConfigSpec)
|
||||
Get-VMToolsUpgradePolicy -VM $_
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -471,10 +540,10 @@ Function Set-VMToolsUpgradePolicy {
|
||||
Function Invoke-VMToolsListProcessInVM {
|
||||
<#
|
||||
.Synopsis
|
||||
This cmdlet lists the processes in the virtual machine.
|
||||
This advanced function lists the processes in the virtual machine.
|
||||
|
||||
.Description
|
||||
This cmdlet lists the running processes in the virtual machine.
|
||||
This advanced function lists the running processes in the virtual machine.
|
||||
|
||||
.PARAMETER VM
|
||||
Specifies the virtual machine which you want to list the processes of.
|
||||
@@ -503,7 +572,7 @@ Function Invoke-VMToolsListProcessInVM {
|
||||
List the processes in the "MyVMName" VM.
|
||||
|
||||
.NOTES
|
||||
This cmdlet lists processes in the guest OS of virtual machine.
|
||||
This advanced function lists processes in the guest OS of virtual machine.
|
||||
A VMTools should already be running in the guest OS.
|
||||
|
||||
.NOTES
|
||||
@@ -559,10 +628,10 @@ Function Invoke-VMToolsListProcessInVM {
|
||||
Function Update-VMToolsImageLocation {
|
||||
<#
|
||||
.Synopsis
|
||||
This cmdlet updates the link /productLocker in ESXi host.
|
||||
This advanced function updates the link /productLocker in ESXi host.
|
||||
|
||||
.Description
|
||||
This cmdlet updates the link /productLocker in ESXi host directly to avoid host reboot.
|
||||
This advanced function updates the link /productLocker in ESXi host directly to avoid host reboot.
|
||||
|
||||
.Parameter VMHost
|
||||
Specifies the ESXi host on which you want to update the /productLocker link.
|
||||
@@ -574,7 +643,7 @@ Function Update-VMToolsImageLocation {
|
||||
Specifies the password you want to use for authenticating with the ESXi host.
|
||||
|
||||
.Parameter ImageLocation
|
||||
Specifies the new image location where you want /producterLocker to link.
|
||||
Specifies the new image location Where-Object you want /producterLocker to link.
|
||||
|
||||
.Example
|
||||
C:\PS> Import-Module .\VMToolsManagement.psm1
|
||||
@@ -586,9 +655,9 @@ Function Update-VMToolsImageLocation {
|
||||
Update the link /producterLocker on $SampleHost to point to '/locker/packages/6.5.0/'.
|
||||
|
||||
.NOTES
|
||||
This cmdlet connects to ESXi host to execute shell command directly.
|
||||
This advanced function connects to ESXi host to execute shell command directly.
|
||||
Make sure the SSH service on ESXi host is enabled, and a SSH library(Posh-SSH or SSH-Sessions etc.)
|
||||
for powershell is already installed on client where you call This cmdlet.
|
||||
for powershell is already installed on client Where-Object you call this advanced function.
|
||||
You can instal Posh-SSH by executing:
|
||||
iex (New-Object Net.WebClient).DownloadString("https://gist.github.com/darkoperator/6152630/raw/c67de4f7cd780ba367cccbc2593f38d18ce6df89/instposhsshdev")
|
||||
For SSH-Sessions installation and usage, please refer to
|
||||
@@ -628,7 +697,7 @@ Function Update-VMToolsImageLocation {
|
||||
|
||||
Process {
|
||||
if (-not (Get-Command New-SSHSession)) {
|
||||
Throw "This cmdlet depends on SSH library. Please ensure a SSH library is already installed!"
|
||||
Throw "This advanced function depends on SSH library. Please ensure a SSH library is already installed!"
|
||||
}
|
||||
|
||||
$password = new-object System.Security.SecureString
|
||||
@@ -656,18 +725,21 @@ Function Update-VMToolsImageLocation {
|
||||
}
|
||||
}
|
||||
|
||||
Function Update-VMToolsConfInVM {
|
||||
Function Set-VMToolsConfInVM {
|
||||
<#
|
||||
.Synopsis
|
||||
This cmdlet updates the tools.conf content in guest OS.
|
||||
This advanced function sets the tools.conf content in guest OS.
|
||||
|
||||
.Description
|
||||
This cmdlet copies the tools.conf in gueset OS of virtual machine to localhost,
|
||||
then updates it locally by setting "vmtoolsd.level = info" and copies it back to the guest OS.
|
||||
This advanced function copies the tools.conf in gueset OS of virtual machine to localhost,
|
||||
then sets it locally by setting "vmtoolsd.level" to a valid level and copies it back to the guest OS.
|
||||
|
||||
.PARAMETER VM
|
||||
Specifies the virtual machine to update.
|
||||
|
||||
.PARAMETER LogLevel
|
||||
Specifies the desired log level to log.
|
||||
|
||||
.Parameter GuestUser
|
||||
Specifies the user name you want to use for authenticating with the guest OS.
|
||||
|
||||
@@ -684,16 +756,18 @@ Function Update-VMToolsConfInVM {
|
||||
Updates the tools.conf in $SampleVM, changes the vmtoolsd log level to info ("vmtoolsd.level = info") for example.
|
||||
|
||||
.NOTES
|
||||
This cmdlet updates the tools.conf in guest OS. A VMTools should already be running in the guest OS.
|
||||
This advanced function updates the tools.conf in guest OS. A VMTools should already be running in the guest OS.
|
||||
|
||||
.NOTES
|
||||
Author : Daoyuan Wang
|
||||
Author email : daoyuanw@vmware.com
|
||||
Version : 1.0
|
||||
Version : 1.1
|
||||
Update Author : Kyle Ruddy
|
||||
Update email : kmruddy@gmail.com
|
||||
==========Tested Against Environment==========
|
||||
VMware vSphere Hypervisor(ESXi) Version : 6.5 (build 4564106)
|
||||
VMware vCenter Server Version : 6.5 (build 4602587)
|
||||
PowerCLI Version : PowerCLI 6.5 (build 4624819)
|
||||
VMware vSphere Hypervisor(ESXi) Version : 6.5 (build 4564106)(build 7388607)
|
||||
VMware vCenter Server Version : 6.5 (build 4602587)(build 7312210)
|
||||
PowerCLI Version : PowerCLI 6.5 (build 4624819)(build 7155375)
|
||||
PowerShell Version : 5.1
|
||||
#>
|
||||
|
||||
@@ -707,6 +781,17 @@ Function Update-VMToolsConfInVM {
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine] $VM,
|
||||
|
||||
[Parameter(Mandatory=$true,
|
||||
Position = 1)]
|
||||
[ValidateSet("none",
|
||||
"critical",
|
||||
"error",
|
||||
"warning",
|
||||
"message",
|
||||
"info",
|
||||
"debug")]
|
||||
[String] $LogLevel,
|
||||
|
||||
[Parameter(Mandatory=$true)]
|
||||
[String] $GuestUser,
|
||||
|
||||
@@ -756,7 +841,7 @@ Function Update-VMToolsConfInVM {
|
||||
# Updates tools.conf by setting vmtoolsd.level = info, just for example.
|
||||
#############################################################################
|
||||
$confContent = Get-Content $localToolsConfFile
|
||||
$updatedContent = "vmtoolsd.level = info"
|
||||
$updatedContent = "vmtoolsd.level = $LogLevel"
|
||||
|
||||
Write-Verbose "Editing tools.conf (set 'vmtoolsd.level = info' for example)..."
|
||||
if ($confContent -match "vmtoolsd\.level") {
|
||||
@@ -775,19 +860,23 @@ Function Update-VMToolsConfInVM {
|
||||
-GuestUser $GuestUser -GuestPassword $GuestPassword -Force -ErrorAction:Stop
|
||||
} catch {
|
||||
Write-Error "Failed to update tools.conf of $VM"
|
||||
Write-Verbose "Removing the local tools configuration file"
|
||||
Remove-Item $localToolsConfFile
|
||||
return
|
||||
}
|
||||
Write-Host "The tools.conf updated in $VM successfully." -ForegroundColor Green
|
||||
Write-Verbose "Removing the local tools configuration file"
|
||||
Remove-Item $localToolsConfFile
|
||||
}
|
||||
}
|
||||
|
||||
Function Invoke-VMToolsVIBInstall {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
This cmdlet installs VMTool VIB in ESXi hosts.
|
||||
This advanced function installs VMTool VIB in ESXi hosts.
|
||||
|
||||
.DESCRIPTION
|
||||
This cmdlet installs VMTool VIB in specified ESXi hosts.
|
||||
This advanced function installs VMTool VIB in specified ESXi hosts.
|
||||
|
||||
.PARAMETER VMHost
|
||||
Specifies the ESXi hosts which you want to install VMTool VIB in.
|
||||
@@ -816,7 +905,7 @@ Function Invoke-VMToolsVIBInstall {
|
||||
Installs VMTool VIB in ESXi host of the "MyClusterName" cluster.
|
||||
|
||||
.NOTES
|
||||
This cmdlet assumes that you are connected to at least one vCenter Server system.
|
||||
This advanced function assumes that you are connected to at least one vCenter Server system.
|
||||
|
||||
.NOTES
|
||||
Author : Daoyuan Wang
|
||||
@@ -846,7 +935,7 @@ Function Invoke-VMToolsVIBInstall {
|
||||
foreach ($_ in $VMHost) {
|
||||
$esxcli = Get-EsxCLI -VMHost $_ -V2
|
||||
|
||||
$result = $esxcli.software.vib.list.Invoke() | where {$_.name -match 'tools'}
|
||||
$result = $esxcli.software.vib.list.Invoke() | Where-Object {$_.name -match 'tools'}
|
||||
Write-Verbose "Existing tools VIB on $_ before installing: $($result.Name)_$($result.Version)"
|
||||
|
||||
# Install VIBs
|
||||
@@ -861,7 +950,7 @@ Function Invoke-VMToolsVIBInstall {
|
||||
Write-Error "Failed to install VMTools VIB package!"
|
||||
} else {
|
||||
Write-Verbose $result.Message
|
||||
$result = $esxcli.software.vib.list.Invoke() | where {$_.name -match 'tools'}
|
||||
$result = $esxcli.software.vib.list.Invoke() | Where-Object {$_.name -match 'tools'}
|
||||
Write-Verbose "Tools VIB on $_ after installing: $($result.Name)_$($result.Version)"
|
||||
Write-Host "VMTools VIB package installed on $_ successfully." -ForegroundColor Green
|
||||
}
|
||||
@@ -872,10 +961,10 @@ Function Invoke-VMToolsVIBInstall {
|
||||
Function Invoke-VMToolsUpgradeInVMs {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
This cmdlet upgrades VMTools to the version bundled by ESXi host.
|
||||
This advanced function upgrades VMTools to the version bundled by ESXi host.
|
||||
|
||||
.DESCRIPTION
|
||||
This cmdlet upgrades VMTools of specified virtual machines to the version
|
||||
This advanced function upgrades VMTools of specified virtual machines to the version
|
||||
bundled by ESXi host. You can also specify the number of virtual machines
|
||||
to upgrade in parallel.
|
||||
|
||||
@@ -896,7 +985,7 @@ Function Invoke-VMToolsUpgradeInVMs {
|
||||
C:\PS> $VCServer = Connect-VIServer -Server <vCenter Server IP> -User <vCenter User> -Password <vCenter Password>
|
||||
C:\PS> Get-VM -Server $VCServer | Invoke-VMToolsUpgradeInVMs -MaxParallelUpgrades 5
|
||||
|
||||
Upgrades VMTools of all virtual machines in the $VCServer vCetner Server, 5 at a time in parallel.
|
||||
Upgrades VMTools of all virtual machines in the $VCServer vCenter Server, 5 at a time in parallel.
|
||||
|
||||
.EXAMPLE
|
||||
C:\PS> Get-VM | Invoke-VMToolsUpgradeInVMs -GuestOSType windows -MaxParallelUpgrades 1 | ft -Autosize
|
||||
@@ -929,7 +1018,7 @@ Function Invoke-VMToolsUpgradeInVMs {
|
||||
Upgrades VMTools of virtual machines on the "MyESXiHostName" ESXi host, 5 at a time.
|
||||
|
||||
.NOTES
|
||||
This cmdlet assumes an old VMTools is already running in the virtual machine.
|
||||
This advanced function assumes an old VMTools is already running in the virtual machine.
|
||||
|
||||
.NOTES
|
||||
Author : Daoyuan Wang
|
||||
@@ -1026,7 +1115,7 @@ Function Invoke-VMToolsUpgradeInVMs {
|
||||
# Load PowerCLI module and connect to VCServer, as child thread environment is independent with parent
|
||||
if(-not $global:DefaultVIServer) {
|
||||
$moduleName = "vmware.vimautomation.core"
|
||||
if(-not (Get-Module | Where {$_.name -eq $moduleName})) {
|
||||
if(-not (Get-Module | Where-Object {$_.name -eq $moduleName})) {
|
||||
try {
|
||||
Import-Module $moduleName -ErrorAction SilentlyContinue | Out-Null
|
||||
}
|
||||
@@ -1130,7 +1219,7 @@ Function Invoke-VMToolsUpgradeInVMs {
|
||||
|
||||
End {
|
||||
#Verify all threads completed
|
||||
while (($jobs | Where {$_.Handle.iscompleted -ne ‘Completed’}).Count -gt 0) {
|
||||
while (($jobs | Where-Object {$_.Handle.iscompleted -ne "Completed"}).Count -gt 0) {
|
||||
Start-Sleep -Seconds 5
|
||||
}
|
||||
|
||||
@@ -1146,4 +1235,4 @@ Function Invoke-VMToolsUpgradeInVMs {
|
||||
}
|
||||
}
|
||||
|
||||
Export-ModuleMember *-*
|
||||
Export-ModuleMember *-*
|
||||
|
||||
21
Modules/VMware-vCD-Module/LICENSE
Normal file
21
Modules/VMware-vCD-Module/LICENSE
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2018 Markus Kraus
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Modulmanifest für das Modul "PSGet_VMware-vCD-Module"
|
||||
# Modulmanifest f<EFBFBD>r das Modul "PSGet_VMware-vCD-Module"
|
||||
#
|
||||
# Generiert von: Markus
|
||||
#
|
||||
@@ -8,52 +8,52 @@
|
||||
|
||||
@{
|
||||
|
||||
# Die diesem Manifest zugeordnete Skript- oder Binärmoduldatei.
|
||||
# Die diesem Manifest zugeordnete Skript- oder Bin<EFBFBD>rmoduldatei.
|
||||
# RootModule = ''
|
||||
|
||||
# Die Versionsnummer dieses Moduls
|
||||
ModuleVersion = '1.0.0'
|
||||
ModuleVersion = '1.3.0'
|
||||
|
||||
# ID zur eindeutigen Kennzeichnung dieses Moduls
|
||||
GUID = '1ef8a2de-ca22-4c88-8cdb-e00f35007d2a'
|
||||
|
||||
# Autor dieses Moduls
|
||||
Author = 'Markus'
|
||||
Author = 'Markus Kraus'
|
||||
|
||||
# Unternehmen oder Hersteller dieses Moduls
|
||||
CompanyName = 'mycloudrevolution.com'
|
||||
|
||||
# Urheberrechtserklärung für dieses Modul
|
||||
# Urheberrechtserkl<EFBFBD>rung f<EFBFBD>r dieses Modul
|
||||
Copyright = '(c) 2017 Markus. Alle Rechte vorbehalten.'
|
||||
|
||||
# Beschreibung der von diesem Modul bereitgestellten Funktionen
|
||||
# Description = ''
|
||||
Description = 'This a POwerShell Module based on VMware PowerCLI vCloud Director Module to extend its function'
|
||||
|
||||
# Die für dieses Modul mindestens erforderliche Version des Windows PowerShell-Moduls
|
||||
# Die f<EFBFBD>r dieses Modul mindestens erforderliche Version des Windows PowerShell-Moduls
|
||||
# PowerShellVersion = ''
|
||||
|
||||
# Der Name des für dieses Modul erforderlichen Windows PowerShell-Hosts
|
||||
# Der Name des f<EFBFBD>r dieses Modul erforderlichen Windows PowerShell-Hosts
|
||||
# PowerShellHostName = ''
|
||||
|
||||
# Die für dieses Modul mindestens erforderliche Version des Windows PowerShell-Hosts
|
||||
# Die f<EFBFBD>r dieses Modul mindestens erforderliche Version des Windows PowerShell-Hosts
|
||||
# PowerShellHostVersion = ''
|
||||
|
||||
# Die für dieses Modul mindestens erforderliche Microsoft .NET Framework-Version
|
||||
# Die f<EFBFBD>r dieses Modul mindestens erforderliche Microsoft .NET Framework-Version
|
||||
# DotNetFrameworkVersion = ''
|
||||
|
||||
# Die für dieses Modul mindestens erforderliche Version der CLR (Common Language Runtime)
|
||||
# Die f<EFBFBD>r dieses Modul mindestens erforderliche Version der CLR (Common Language Runtime)
|
||||
# CLRVersion = ''
|
||||
|
||||
# Die für dieses Modul erforderliche Prozessorarchitektur ("Keine", "X86", "Amd64").
|
||||
# Die f<EFBFBD>r dieses Modul erforderliche Prozessorarchitektur ("Keine", "X86", "Amd64").
|
||||
# ProcessorArchitecture = ''
|
||||
|
||||
# Die Module, die vor dem Importieren dieses Moduls in die globale Umgebung geladen werden müssen
|
||||
# RequiredModules = @()
|
||||
# Die Module, die vor dem Importieren dieses Moduls in die globale Umgebung geladen werden m<EFBFBD>ssen
|
||||
RequiredModules = @('VMware.VimAutomation.Cloud')
|
||||
|
||||
# Die Assemblys, die vor dem Importieren dieses Moduls geladen werden müssen
|
||||
# Die Assemblys, die vor dem Importieren dieses Moduls geladen werden m<EFBFBD>ssen
|
||||
# RequiredAssemblies = @()
|
||||
|
||||
# Die Skriptdateien (PS1-Dateien), die vor dem Importieren dieses Moduls in der Umgebung des Aufrufers ausgeführt werden.
|
||||
# Die Skriptdateien (PS1-Dateien), die vor dem Importieren dieses Moduls in der Umgebung des Aufrufers ausgef<EFBFBD>hrt werden.
|
||||
# ScriptsToProcess = @()
|
||||
|
||||
# Die Typdateien (.ps1xml), die beim Importieren dieses Moduls geladen werden sollen
|
||||
@@ -63,14 +63,16 @@ Copyright = '(c) 2017 Markus. Alle Rechte vorbehalten.'
|
||||
# FormatsToProcess = @()
|
||||
|
||||
# Die Module, die als geschachtelte Module des in "RootModule/ModuleToProcess" angegebenen Moduls importiert werden sollen.
|
||||
NestedModules = @('functions\Invoke-MyOnBoarding.psm1',
|
||||
NestedModules = @('functions\Invoke-MyOnBoarding.psm1',
|
||||
'functions\New-MyEdgeGateway.psm1',
|
||||
'functions\New-MyOrg.psm1',
|
||||
'functions\New-MyOrgAdmin.psm1',
|
||||
'functions\New-MyOrgVdc.psm1')
|
||||
'functions\New-MyOrg.psm1',
|
||||
'functions\New-MyOrgAdmin.psm1',
|
||||
'functions\New-MyOrgVdc.psm1',
|
||||
'functions\New-MyOrgNetwork.psm1'
|
||||
)
|
||||
|
||||
# Aus diesem Modul zu exportierende Funktionen
|
||||
FunctionsToExport = 'Invoke-MyOnBoarding', 'New-MyEdgeGateway', 'New-MyOrg', 'New-MyOrgAdmin', 'New-MyOrgVdc'
|
||||
FunctionsToExport = 'Invoke-MyOnBoarding', 'New-MyEdgeGateway', 'New-MyOrg', 'New-MyOrgAdmin', 'New-MyOrgVdc', 'New-MyOrgNetwork'
|
||||
|
||||
# Aus diesem Modul zu exportierende Cmdlets
|
||||
CmdletsToExport = '*'
|
||||
@@ -90,28 +92,28 @@ AliasesToExport = '*'
|
||||
# Liste aller Dateien in diesem Modulpaket
|
||||
# FileList = @()
|
||||
|
||||
# Die privaten Daten, die an das in "RootModule/ModuleToProcess" angegebene Modul übergeben werden sollen. Diese können auch eine PSData-Hashtabelle mit zusätzlichen von PowerShell verwendeten Modulmetadaten enthalten.
|
||||
# Die privaten Daten, die an das in "RootModule/ModuleToProcess" angegebene Modul <EFBFBD>bergeben werden sollen. Diese k<EFBFBD>nnen auch eine PSData-Hashtabelle mit zus<EFBFBD>tzlichen von PowerShell verwendeten Modulmetadaten enthalten.
|
||||
PrivateData = @{
|
||||
|
||||
PSData = @{
|
||||
|
||||
# Tags applied to this module. These help with module discovery in online galleries.
|
||||
# Tags = @()
|
||||
Tags = @('VMware', 'vCloud', 'PowerCLI', 'vCloudDirector', 'Automation', 'EdgeGateway', 'OrgNetwork')
|
||||
|
||||
# A URL to the license for this module.
|
||||
# LicenseUri = ''
|
||||
LicenseUri = 'https://github.com/mycloudrevolution/VMware-vCD-Module/blob/master/LICENSE'
|
||||
|
||||
# A URL to the main website for this project.
|
||||
# ProjectUri = ''
|
||||
ProjectUri = 'https://github.com/mycloudrevolution/VMware-vCD-Module'
|
||||
|
||||
# A URL to an icon representing this module.
|
||||
# IconUri = ''
|
||||
IconUri = 'https://github.com/mycloudrevolution/VMware-vCD-Module/blob/master/media/vCD_Small.png'
|
||||
|
||||
# ReleaseNotes of this module
|
||||
# ReleaseNotes = ''
|
||||
|
||||
# External dependent modules of this module
|
||||
# ExternalModuleDependencies = ''
|
||||
ExternalModuleDependencies = 'VMware.VimAutomation.Cloud'
|
||||
|
||||
} # End of PSData hashtable
|
||||
|
||||
@@ -120,7 +122,7 @@ PrivateData = @{
|
||||
# HelpInfo-URI dieses Moduls
|
||||
# HelpInfoURI = ''
|
||||
|
||||
# Standardpräfix für Befehle, die aus diesem Modul exportiert werden. Das Standardpräfix kann mit "Import-Module -Prefix" überschrieben werden.
|
||||
# Standardpr<EFBFBD>fix f<EFBFBD>r Befehle, die aus diesem Modul exportiert werden. Das Standardpr<EFBFBD>fix kann mit "Import-Module -Prefix" <EFBFBD>berschrieben werden.
|
||||
# DefaultCommandPrefix = ''
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
#Requires -Version 4
|
||||
#Requires -Modules VMware.VimAutomation.Cloud, @{ModuleName="VMware.VimAutomation.Cloud";ModuleVersion="6.3.0.0"}
|
||||
Function Invoke-MyOnBoarding {
|
||||
Function Invoke-MyOnBoarding {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Creates all vCD Objecst for a new IAAS Customer
|
||||
@@ -158,18 +156,22 @@ Function Invoke-MyOnBoarding {
|
||||
|
||||
if ($Configs.OrgVdc.ExternalNetwork -and $Configs.OrgVdc.EdgeGateway -like "Yes"){
|
||||
Write-Host "Edge Gateway for Org VDC '$($Configs.OrgVdc.Name)' Requested!"
|
||||
$Trash = New-MyOrgVdc -Name $Configs.OrgVdc.Name -CPULimit $CPULimit -MEMLimit $MEMLimit -StorageLimit $StorageLimit -Networkpool $Configs.OrgVdc.NetworkPool `
|
||||
$Trash = New-MyOrgVdc -Name $Configs.OrgVdc.Name -CPULimit $CPULimit -MEMLimit $MEMLimit -StorageLimit $StorageLimit -Networkpool $Configs.OrgVdc.NetworkPool `
|
||||
-StorageProfile $Configs.OrgVdc.StorageProfile -ProviderVDC $Configs.OrgVdc.ProviderVDC -Org $Configs.Org.Name -Enabled:$Enabled
|
||||
|
||||
$EdgeName = $Configs.Org.Name + "-ESG01"
|
||||
$EdgeName = $Configs.Org.Name + "-ESG01"
|
||||
$Trash = New-MyEdgeGateway -Name $EdgeName -OrgVDCName $Configs.OrgVdc.Name -Orgname $Configs.Org.Name -ExternalNetwork $Configs.OrgVdc.ExternalNetwork `
|
||||
-IPAddress $Configs.OrgVdc.IPAddress -SubnetMask $Configs.OrgVdc.SubnetMask -Gateway $Configs.OrgVdc.Gateway -IPRangeStart $Configs.OrgVdc.IPRangeStart -IPRangeEnd $Configs.OrgVdc.IPRangeEnd
|
||||
}
|
||||
elseif ($Configs.OrgVdc.ExternalNetwork -and $Configs.OrgVdc.EdgeGateway -like "No"){
|
||||
Write-Host "External Network for Org VDC '$($Configs.OrgVdc.Name)' Requested!"
|
||||
elseif ($Configs.OrgVdc.ExternalNetwork -and $Configs.OrgVdc.EdgeGateway -like "No"){
|
||||
$Trash = New-MyOrgVdc -Name $Configs.OrgVdc.Name -CPULimit $CPULimit -MEMLimit $MEMLimit -StorageLimit $StorageLimit -Networkpool $Configs.OrgVdc.NetworkPool `
|
||||
-StorageProfile $Configs.OrgVdc.StorageProfile -ProviderVDC $Configs.OrgVdc.ProviderVDC -ExternalNetwork $Configs.OrgVdc.ExternalNetwork -Org $Configs.Org.Name -Enabled:$Enabled
|
||||
}
|
||||
else {
|
||||
Write-Host "No external Connection for Org VDC '$($Configs.OrgVdc.Name)' Requested!"
|
||||
}
|
||||
$Trash = New-PecOrgVdc -Name $Configs.OrgVdc.Name -CPULimit $CPULimit -MEMLimit $MEMLimit -StorageLimit $StorageLimit -Networkpool $ProVdcNetworkPool.Name `
|
||||
-StorageProfile $Configs.OrgVdc.StorageProfile -ProviderVDC $Configs.OrgVdc.ProviderVDC -Org $Configs.Org.Name -Enabled:$Enabled
|
||||
}
|
||||
Write-Host "$(Get-Date -Format "yyyy-MM-dd HH:mm:ss") Creating new OrgVdc OK" -ForegroundColor Green
|
||||
Get-OrgVdc -Org $Configs.Org.Name -Name $Configs.OrgVdc.Name | Select-Object Name, Enabled, CpuAllocationGhz, MemoryLimitGB, StorageLimitGB, AllocationModel, ThinProvisioned, UseFastProvisioning, `
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
#Requires -Version 4
|
||||
#Requires -Modules VMware.VimAutomation.Cloud, @{ModuleName="VMware.VimAutomation.Cloud";ModuleVersion="6.3.0.0"}
|
||||
Function New-MyEdgeGateway {
|
||||
Function New-MyEdgeGateway {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Creates a new Edge Gateway with Default Parameters
|
||||
@@ -9,7 +7,6 @@ Function New-MyEdgeGateway {
|
||||
Creates a new Edge Gateway with Default Parameters
|
||||
|
||||
Default Parameters are:
|
||||
* Size
|
||||
* HA State
|
||||
* DNS Relay
|
||||
|
||||
@@ -17,14 +14,14 @@ Function New-MyEdgeGateway {
|
||||
.NOTES
|
||||
File Name : New-MyEdgeGateway.ps1
|
||||
Author : Markus Kraus
|
||||
Version : 1.0
|
||||
Version : 1.1
|
||||
State : Ready
|
||||
|
||||
.LINK
|
||||
https://mycloudrevolution.com/
|
||||
|
||||
.EXAMPLE
|
||||
New-MyEdgeGateway -Name "TestEdge" -OrgVDCName "TestVDC" -OrgName "TestOrg" -ExternalNetwork "ExternalNetwork" -IPAddress "192.168.100.1" -SubnetMask "255.255.255.0" -Gateway "192.168.100.254" -IPRangeStart ""192.168.100.2" -IPRangeEnd ""192.168.100.3" -Verbose
|
||||
New-MyEdgeGateway -Name "TestEdge" -OrgVDCName "TestVDC" -OrgName "TestOrg" -Size compact -ExternalNetwork "ExternalNetwork" -IPAddress "192.168.100.1" -SubnetMask "255.255.255.0" -Gateway "192.168.100.254" -IPRangeStart ""192.168.100.2" -IPRangeEnd ""192.168.100.3" -Verbose
|
||||
|
||||
.PARAMETER Name
|
||||
Name of the New Edge Gateway as String
|
||||
@@ -35,6 +32,9 @@ Function New-MyEdgeGateway {
|
||||
.PARAMETER OrgName
|
||||
Org where the new Edge Gateway should be created as string
|
||||
|
||||
.PARAMETER Size
|
||||
Size of the new Edge Gateway as string
|
||||
|
||||
.PARAMETER ExternalNetwork
|
||||
External Network of the new Edge Gateway as String
|
||||
|
||||
@@ -69,6 +69,10 @@ Function New-MyEdgeGateway {
|
||||
[Parameter(Mandatory=$True, ValueFromPipeline=$False, HelpMessage="Org where the new Edge Gateway should be created as string")]
|
||||
[ValidateNotNullorEmpty()]
|
||||
[String] $OrgName,
|
||||
[Parameter(Mandatory=$True, ValueFromPipeline=$False, HelpMessage="Size of the new Edge Gateway as string")]
|
||||
[ValidateNotNullorEmpty()]
|
||||
[ValidateSet("compact","full")]
|
||||
[String] $Size,
|
||||
[Parameter(Mandatory=$True, ValueFromPipeline=$False, HelpMessage="External Network of the New Edge Gateway as String")]
|
||||
[ValidateNotNullorEmpty()]
|
||||
[String] $ExternalNetwork,
|
||||
@@ -113,7 +117,7 @@ Function New-MyEdgeGateway {
|
||||
$EdgeGateway.Name = $Name
|
||||
$EdgeGateway.Configuration = New-Object VMware.VimAutomation.Cloud.Views.GatewayConfiguration
|
||||
#$EdgeGateway.Configuration.BackwardCompatibilityMode = $false
|
||||
$EdgeGateway.Configuration.GatewayBackingConfig = "compact"
|
||||
$EdgeGateway.Configuration.GatewayBackingConfig = $Size
|
||||
$EdgeGateway.Configuration.UseDefaultRouteForDnsRelay = $false
|
||||
$EdgeGateway.Configuration.HaEnabled = $false
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
#Requires -Version 4
|
||||
#Requires -Modules VMware.VimAutomation.Cloud, @{ModuleName="VMware.VimAutomation.Cloud";ModuleVersion="6.3.0.0"}
|
||||
Function New-MyOrg {
|
||||
Function New-MyOrg {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Creates a new vCD Org with Default Parameters
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
#Requires -Version 4
|
||||
#Requires -Modules VMware.VimAutomation.Cloud, @{ModuleName="VMware.VimAutomation.Cloud";ModuleVersion="6.3.0.0"}
|
||||
Function New-MyOrgAdmin {
|
||||
Function New-MyOrgAdmin {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Creates a new vCD Org Admin with Default Parameters
|
||||
|
||||
166
Modules/VMware-vCD-Module/functions/New-MyOrgNetwork.psm1
Normal file
166
Modules/VMware-vCD-Module/functions/New-MyOrgNetwork.psm1
Normal file
@@ -0,0 +1,166 @@
|
||||
Function New-MyOrgNetwork {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Creates a new Org Network with Default Parameters
|
||||
|
||||
.DESCRIPTION
|
||||
|
||||
.NOTES
|
||||
File Name : New-MyOrgNetwork.ps1
|
||||
Author : Markus Kraus
|
||||
Version : 1.1
|
||||
State : Ready
|
||||
|
||||
.LINK
|
||||
https://mycloudrevolution.com
|
||||
|
||||
.EXAMPLE
|
||||
New-MyOrgNetwork -Name Test -OrgVdcName "Test-OrgVDC" -OrgName "Test-Org" -EdgeName "Test-OrgEdge" -SubnetMask 255.255.255.0 -Gateway 192.168.66.1 -IPRangeStart 192.168.66.100 -IPRangeEnd 192.168.66.200
|
||||
|
||||
.EXAMPLE
|
||||
New-MyOrgNetwork -Name Test -OrgVdcName "Test-OrgVDC" -OrgName "Test-Org" -EdgeName "Test-OrgEdge" -SubnetMask 255.255.255.0 -Gateway 192.168.66.1 -IPRangeStart 192.168.66.100 -IPRangeEnd 192.168.66.200 -Shared:$False
|
||||
|
||||
.EXAMPLE
|
||||
$params = @{ 'Name' = 'Test';
|
||||
'OrgVdcName'= 'Test-OrgVDC';
|
||||
'OrgName'='Test-Org';
|
||||
'EdgeName'='Test-OrgEdge';
|
||||
'SubnetMask' = '255.255.255.0';
|
||||
'Gateway' = '192.168.66.1';
|
||||
'IPRangeStart' = '192.168.66.100';
|
||||
'IPRangeEnd' = '192.168.66.200'
|
||||
}
|
||||
New-MyOrgNetwork @params -Verbose
|
||||
|
||||
.PARAMETER Name
|
||||
Name of the New Org Network as String
|
||||
|
||||
.PARAMETER OrgVDCName
|
||||
OrgVDC where the new Org Network should be created as string
|
||||
|
||||
.PARAMETER OrgName
|
||||
Org where the newOrg Networkshould be created as string
|
||||
|
||||
.PARAMETER EdgeName
|
||||
Edge Gateway Name for the new Org Network as String
|
||||
|
||||
.PARAMETER SubnetMask
|
||||
Subnet Mask of the New Org Network as IP Address
|
||||
|
||||
.PARAMETER Gateway
|
||||
Gateway of the New Org Network as IP Address
|
||||
|
||||
.PARAMETER IPRangeStart
|
||||
IP Range Start of the New Org Network as IP Address
|
||||
|
||||
.PARAMETER IPRangeEnd
|
||||
IP Range End of the New Org Network as IP Address
|
||||
|
||||
.PARAMETER Shared
|
||||
Switch for Shared OrgVDC Network
|
||||
|
||||
Default: $True
|
||||
|
||||
.PARAMETER Timeout
|
||||
Timeout for the Org Network to become Ready
|
||||
|
||||
Default: 120s
|
||||
|
||||
#>
|
||||
Param (
|
||||
[Parameter(Mandatory=$True, ValueFromPipeline=$False, HelpMessage="Name of the New Org Network as String")]
|
||||
[ValidateNotNullorEmpty()]
|
||||
[String] $Name,
|
||||
[Parameter(Mandatory=$True, ValueFromPipeline=$False, HelpMessage="OrgVDC where the new Org Network should be created as string")]
|
||||
[ValidateNotNullorEmpty()]
|
||||
[String] $OrgVdcName,
|
||||
[Parameter(Mandatory=$True, ValueFromPipeline=$False, HelpMessage="Org where the new Org Network should be created as string")]
|
||||
[ValidateNotNullorEmpty()]
|
||||
[String] $OrgName,
|
||||
[Parameter(Mandatory=$True, ValueFromPipeline=$False, HelpMessage="Edge Gateway Name for the new Org Network as String")]
|
||||
[ValidateNotNullorEmpty()]
|
||||
[String] $EdgeName,
|
||||
[Parameter(Mandatory=$True, ValueFromPipeline=$False, HelpMessage="Subnet Mask of the New Org Network as IP Address")]
|
||||
[ValidateNotNullorEmpty()]
|
||||
[IPAddress] $SubnetMask,
|
||||
[Parameter(Mandatory=$True, ValueFromPipeline=$False, HelpMessage="Gateway of the New Org Network as IP Address")]
|
||||
[ValidateNotNullorEmpty()]
|
||||
[IPAddress] $Gateway,
|
||||
[Parameter(Mandatory=$True, ValueFromPipeline=$False, HelpMessage="IP Range Start the New Org Network as IP Address")]
|
||||
[ValidateNotNullorEmpty()]
|
||||
[IPAddress] $IPRangeStart,
|
||||
[Parameter(Mandatory=$True, ValueFromPipeline=$False, HelpMessage="IP Range End the New Org Network as IP Address")]
|
||||
[ValidateNotNullorEmpty()]
|
||||
[IPAddress] $IPRangeEnd,
|
||||
[Parameter(Mandatory=$False, ValueFromPipeline=$False, HelpMessage="Switch for Shared OrgVDC Network")]
|
||||
[ValidateNotNullorEmpty()]
|
||||
[Bool] $Shared = $True,
|
||||
[Parameter(Mandatory=$False, ValueFromPipeline=$False,HelpMessage="Timeout for the Org Network to become Ready")]
|
||||
[ValidateNotNullorEmpty()]
|
||||
[int] $Timeout = 120
|
||||
)
|
||||
Process {
|
||||
|
||||
## Get Org vDC
|
||||
Write-Verbose "Get Org vDC"
|
||||
[Array] $orgVdc = Get-Org -Name $OrgName | Get-OrgVdc -Name $OrgVdcName
|
||||
|
||||
if ( $orgVdc.Count -gt 1) {
|
||||
throw "Multiple OrgVdcs found!"
|
||||
}
|
||||
elseif ( $orgVdc.Count -lt 1) {
|
||||
throw "No OrgVdc found!"
|
||||
}
|
||||
$orgVdcView = $orgVdc| Get-CIView
|
||||
|
||||
## Get EdgeGateway
|
||||
Write-Verbose "Get EdgeGateway"
|
||||
[Array] $edgeGateway = Search-Cloud -QueryType EdgeGateway -Name $EdgeName | Get-CIView
|
||||
if ( $edgeGateway.Count -gt 1) {
|
||||
throw "Multiple EdgeGateways found!"
|
||||
}
|
||||
elseif ( $edgeGateway.Count -lt 1) {
|
||||
throw "No EdgeGateway found!"
|
||||
}
|
||||
|
||||
## Define Org Network
|
||||
Write-Verbose "Define Org Network"
|
||||
$OrgNetwork = new-object vmware.vimautomation.cloud.views.orgvdcnetwork
|
||||
$OrgNetwork.name = $Name
|
||||
$OrgNetwork.edgegateway = $edgeGateway.id
|
||||
$OrgNetwork.isshared = $Shared
|
||||
|
||||
$OrgNetwork.configuration = new-object vmware.vimautomation.cloud.views.networkconfiguration
|
||||
$OrgNetwork.configuration.fencemode = "natRouted"
|
||||
$OrgNetwork.configuration.ipscopes = new-object vmware.vimautomation.cloud.views.ipscopes
|
||||
|
||||
$Scope = new-object vmware.vimautomation.cloud.views.ipScope
|
||||
$Scope.gateway = $Gateway
|
||||
$Scope.netmask = $SubnetMask
|
||||
|
||||
$Scope.ipranges = new-object vmware.vimautomation.cloud.views.ipranges
|
||||
$Scope.ipranges.iprange = new-object vmware.vimautomation.cloud.views.iprange
|
||||
$Scope.ipranges.iprange[0].startaddress = $IPRangeStart
|
||||
$Scope.ipranges.iprange[0].endaddress = $IPRangeEnd
|
||||
|
||||
$OrgNetwork.configuration.ipscopes.ipscope += $Scope
|
||||
|
||||
## Create Org Network
|
||||
Write-Verbose "Create Org Network"
|
||||
$CreateOrgNetwork = $orgVdcView.CreateNetwork($OrgNetwork)
|
||||
|
||||
## Wait for Org Network to become Ready
|
||||
Write-Verbose "Wait for Org Network to become Ready"
|
||||
while(!(Get-OrgVdcNetwork -Id $CreateOrgNetwork.Id -ErrorAction SilentlyContinue)){
|
||||
$i++
|
||||
Start-Sleep 5
|
||||
if($i -gt $Timeout) { Write-Error "Creating Org Network."; break}
|
||||
Write-Progress -Activity "Creating Org Network" -Status "Wait for Network to become Ready..."
|
||||
}
|
||||
Write-Progress -Activity "Creating Org Network" -Completed
|
||||
Start-Sleep 1
|
||||
|
||||
Get-OrgVdcNetwork -Id $CreateOrgNetwork.Id | Select-Object Name, OrgVdc, NetworkType, DefaultGateway, Netmask, StaticIPPool, @{ N='isShared'; E = {$_.ExtensionData.isShared} } | Format-Table -AutoSize
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,4 @@
|
||||
#Requires -Version 4
|
||||
#Requires -Modules VMware.VimAutomation.Cloud, @{ModuleName="VMware.VimAutomation.Cloud";ModuleVersion="6.3.0.0"}
|
||||
Function New-MyOrgVdc {
|
||||
Function New-MyOrgVdc {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Creates a new vCD Org VDC with Default Parameters
|
||||
@@ -9,7 +7,6 @@ Function New-MyOrgVdc {
|
||||
Creates a new vCD Org VDC with Default Parameters
|
||||
|
||||
Default Parameters are:
|
||||
* Allocation Model
|
||||
* Network Quota
|
||||
* VM Quota
|
||||
* 'vCpu In Mhz'
|
||||
@@ -20,27 +17,38 @@ Function New-MyOrgVdc {
|
||||
.NOTES
|
||||
File Name : New-MyOrgVdc.ps1
|
||||
Author : Markus Kraus
|
||||
Version : 1.2
|
||||
Version : 1.3
|
||||
State : Ready
|
||||
|
||||
.LINK
|
||||
https://mycloudrevolution.com/
|
||||
|
||||
.EXAMPLE
|
||||
New-MyOrgVdc -Name "TestVdc" -CPULimit 1000 -MEMLimit 1000 -StorageLimit 1000 -StorageProfile "Standard-DC01" -NetworkPool "NetworkPool-DC01" -ProviderVDC "Provider-VDC-DC01" -Org "TestOrg" -ExternalNetwork "External_OrgVdcNet"
|
||||
New-MyOrgVdc -Name "TestVdc" -AllocationModel AllocationPool -CPULimit 1000 -MEMLimit 1000 -StorageLimit 1000 -StorageProfile "Standard-DC01" -NetworkPool "NetworkPool-DC01" -ProviderVDC "Provider-VDC-DC01" -Org "TestOrg" -ExternalNetwork "External_OrgVdcNet"
|
||||
|
||||
.EXAMPLE
|
||||
New-MyOrgVdc -Name "TestVdc" -CPULimit 1000 -MEMLimit 1000 -StorageLimit 1000 -StorageProfile "Standard-DC01" -NetworkPool "NetworkPool-DC01" -ProviderVDC "Provider-VDC-DC01" -Org "TestOrg"
|
||||
New-MyOrgVdc -Name "TestVdc" -AllocationModel AllocationVApp -StorageLimit 1000 -StorageProfile "Standard-DC01" -NetworkPool "NetworkPool-DC01" -ProviderVDC "Provider-VDC-DC01" -Org "TestOrg"
|
||||
|
||||
.PARAMETER Name
|
||||
Name of the New Org VDC as String
|
||||
|
||||
.PARAMETER AllocationModel
|
||||
Allocation Model of the New Org VDC as String
|
||||
|
||||
.PARAMETER CPULimit
|
||||
CPU Limit (MHz) of the New Org VDC as String
|
||||
|
||||
Default: 0 (Unlimited)
|
||||
|
||||
Note: If AllocationModel is not AllocationVApp (Pay as you go), a limit needs to be set
|
||||
|
||||
.PARAMETER MEMLimit
|
||||
Memory Limit (MB) of the New Org VDC as String
|
||||
|
||||
Default: 0 (Unlimited)
|
||||
|
||||
Note: If AllocationModel is not AllocationVApp (Pay as you go), a limit needs to be set
|
||||
|
||||
.PARAMETER StorageLimit
|
||||
Storage Limit (MB) of the New Org VDC as String
|
||||
|
||||
@@ -76,12 +84,16 @@ Function New-MyOrgVdc {
|
||||
[Parameter(Mandatory=$True, ValueFromPipeline=$False, HelpMessage="Name of the New Org VDC as String")]
|
||||
[ValidateNotNullorEmpty()]
|
||||
[String] $Name,
|
||||
[Parameter(Mandatory=$True, ValueFromPipeline=$False, HelpMessage="CPU Limit (MHz) of the New Org VDC as String")]
|
||||
[Parameter(Mandatory=$True, ValueFromPipeline=$False, HelpMessage="Allocation Model of the New Org VDC as String")]
|
||||
[ValidateNotNullorEmpty()]
|
||||
[int] $CPULimit,
|
||||
[Parameter(Mandatory=$True, ValueFromPipeline=$False, HelpMessage="Memory Limit (MB) of the New Org VDC as String")]
|
||||
[ValidateSet("AllocationPool","AllocationVApp")]
|
||||
[String] $AllocationModel,
|
||||
[Parameter(Mandatory=$False, ValueFromPipeline=$False, HelpMessage="CPU Limit (MHz) of the New Org VDC as String")]
|
||||
[ValidateNotNullorEmpty()]
|
||||
[int] $MEMLimit,
|
||||
[int] $CPULimit = 0,
|
||||
[Parameter(Mandatory=$False, ValueFromPipeline=$False, HelpMessage="Memory Limit (MB) of the New Org VDC as String")]
|
||||
[ValidateNotNullorEmpty()]
|
||||
[int] $MEMLimit = 0,
|
||||
[Parameter(Mandatory=$True, ValueFromPipeline=$False, HelpMessage="Storage Limit (MB) of the New Org VDC as String")]
|
||||
[ValidateNotNullorEmpty()]
|
||||
[int] $StorageLimit,
|
||||
@@ -117,7 +129,7 @@ Function New-MyOrgVdc {
|
||||
$providerVdcRef = New-Object VMware.VimAutomation.Cloud.Views.Reference
|
||||
$providerVdcRef.Href = $OrgVdcproviderVdc.Href
|
||||
$adminVdc.ProviderVdcReference = $providerVdcRef
|
||||
$adminVdc.AllocationModel = "AllocationPool"
|
||||
$adminVdc.AllocationModel = $AllocationModel
|
||||
$adminVdc.ComputeCapacity = New-Object VMware.VimAutomation.Cloud.Views.ComputeCapacity
|
||||
$adminVdc.ComputeCapacity.Cpu = New-Object VMware.VimAutomation.Cloud.Views.CapacityWithUsage
|
||||
$adminVdc.ComputeCapacity.Cpu.Units = "MHz"
|
||||
@@ -132,8 +144,8 @@ Function New-MyOrgVdc {
|
||||
$adminVdc.StorageCapacity.Limit = $StorageLimit
|
||||
$adminVdc.NetworkQuota = 10
|
||||
$adminVdc.VmQuota = 0
|
||||
$adminVdc.VCpuInMhz = 1000
|
||||
$adminVdc.VCpuInMhz2 = 1000
|
||||
$adminVdc.VCpuInMhz = 2000
|
||||
$adminVdc.VCpuInMhz2 = 2000
|
||||
$adminVdc.UsesFastProvisioning = $false
|
||||
$adminVdc.IsThinProvision = $true
|
||||
|
||||
@@ -143,20 +155,21 @@ Function New-MyOrgVdc {
|
||||
$orgVdc = $orgED.CreateVdc($adminVdc)
|
||||
|
||||
## Wait for getting Ready
|
||||
Write-Verbose "Wait for getting Ready"
|
||||
Write-Verbose "Wait for OrgVdc getting Ready after creation"
|
||||
$i = 0
|
||||
while(($orgVdc = Get-OrgVdc -Name $Name -Verbose:$false).Status -eq "NotReady"){
|
||||
$i++
|
||||
Start-Sleep 2
|
||||
if($i -gt $Timeout) { Write-Error "Creating Org Failed."; break}
|
||||
Write-Progress -Activity "Creating Org" -Status "Wait for Org to become Ready..."
|
||||
if($i -gt $Timeout) { Write-Error "Creating OrgVdc Failed."; break}
|
||||
Write-Progress -Activity "Creating OrgVdc" -Status "Wait for OrgVdc to become Ready..."
|
||||
}
|
||||
Write-Progress -Activity "Creating Org" -Completed
|
||||
Write-Progress -Activity "Creating OrgVdc" -Completed
|
||||
Start-Sleep 2
|
||||
|
||||
## Search given Storage Profile
|
||||
Write-Verbose "Search given Storage Profile"
|
||||
$ProVdcStorageProfile = search-cloud -QueryType ProviderVdcStorageProfile -Name $StorageProfile | Get-CIView
|
||||
$Filter = "ProviderVdc==" + $OrgVdcproviderVdc.Id
|
||||
$ProVdcStorageProfile = search-cloud -QueryType ProviderVdcStorageProfile -Name $StorageProfile -Filter $Filter | Get-CIView
|
||||
|
||||
## Create Storage Profile Object with Settings
|
||||
Write-Verbose "Create Storage Profile Object with Settings"
|
||||
@@ -174,14 +187,14 @@ Function New-MyOrgVdc {
|
||||
$orgVdc.ExtensionData.CreateVdcStorageProfile($UpdateParams)
|
||||
|
||||
## Wait for getting Ready
|
||||
Write-Verbose "Wait for getting Ready"
|
||||
Write-Verbose "Wait for OrgVdc getting Ready after update"
|
||||
while(($orgVdc = Get-OrgVdc -Name $name -Verbose:$false).Status -eq "NotReady"){
|
||||
$i++
|
||||
Start-Sleep 1
|
||||
if($i -gt $Timeout) { Write-Error "Update Org Failed."; break}
|
||||
Write-Progress -Activity "Updating Org" -Status "Wait for Org to become Ready..."
|
||||
if($i -gt $Timeout) { Write-Error "Update OrgVdc Failed."; break}
|
||||
Write-Progress -Activity "Updating OrgVdc" -Status "Wait for OrgVdc to become Ready..."
|
||||
}
|
||||
Write-Progress -Activity "Updating Org" -Completed
|
||||
Write-Progress -Activity "Updating OrgVdc" -Completed
|
||||
Start-Sleep 1
|
||||
|
||||
## Search Any-StorageProfile
|
||||
|
||||
93
Modules/VMware.CSP/VMware.CSP.psm1
Normal file
93
Modules/VMware.CSP/VMware.CSP.psm1
Normal file
@@ -0,0 +1,93 @@
|
||||
Function Get-CSPAccessToken {
|
||||
<#
|
||||
.NOTES
|
||||
===========================================================================
|
||||
Created by: William Lam
|
||||
Date: 07/23/2018
|
||||
Organization: VMware
|
||||
Blog: https://www.virtuallyghetto.com
|
||||
Twitter: @lamw
|
||||
===========================================================================
|
||||
|
||||
.DESCRIPTION
|
||||
Converts a Refresh Token from the VMware Console Services Portal
|
||||
to CSP Access Token to access CSP API
|
||||
.PARAMETER RefreshToken
|
||||
The Refresh Token from the VMware Console Services Portal
|
||||
.EXAMPLE
|
||||
Get-CSPAccessToken -RefreshToken $RefreshToken
|
||||
#>
|
||||
Param (
|
||||
[Parameter(Mandatory=$true)][String]$RefreshToken
|
||||
)
|
||||
|
||||
$results = Invoke-WebRequest -Uri "https://console.cloud.vmware.com/csp/gateway/am/api/auth/api-tokens/authorize" -Method POST -Headers @{accept='application/json'} -Body "refresh_token=$RefreshToken"
|
||||
if($results.StatusCode -ne 200) {
|
||||
Write-Host -ForegroundColor Red "Failed to retrieve Access Token, please ensure your VMC Refresh Token is valid and try again"
|
||||
break
|
||||
}
|
||||
$accessToken = ($results | ConvertFrom-Json).access_token
|
||||
Write-Host "CSP Auth Token has been successfully retrieved and saved to `$env:cspAuthToken"
|
||||
$env:cspAuthToken = $accessToken
|
||||
}
|
||||
|
||||
Function Get-CSPServices {
|
||||
<#
|
||||
.NOTES
|
||||
===========================================================================
|
||||
Created by: William Lam
|
||||
Date: 07/23/2018
|
||||
Organization: VMware
|
||||
Blog: https://www.virtuallyghetto.com
|
||||
Twitter: @lamw
|
||||
===========================================================================
|
||||
|
||||
.DESCRIPTION
|
||||
Returns the list of CSP Services avialable for given user
|
||||
.EXAMPLE
|
||||
Get-CSPServices
|
||||
#>
|
||||
If (-Not $env:cspAuthToken) { Write-error "CSP Auth Token not found, please run Get-CSPAccessToken" } Else {
|
||||
$results = Invoke-WebRequest -Uri "https://console.cloud.vmware.com/csp/gateway/slc/api/definitions?expand=1" -Method GET -ContentType "application/json" -UseBasicParsing -Headers @{"csp-auth-token"="$env:cspAuthToken"}
|
||||
((($results.Content) | ConvertFrom-Json).results | where {$_.visible -eq $true}).displayName
|
||||
}
|
||||
}
|
||||
|
||||
Function Get-CSPRefreshTokenExpiry {
|
||||
<#
|
||||
.NOTES
|
||||
===========================================================================
|
||||
Created by: William Lam
|
||||
Date: 01/10/2019
|
||||
Organization: VMware
|
||||
Blog: https://www.virtuallyghetto.com
|
||||
Twitter: @lamw
|
||||
===========================================================================
|
||||
|
||||
.DESCRIPTION
|
||||
Retrieve the expiry for a given CSP Refresh Token
|
||||
.PARAMETER RefreshToken
|
||||
Retrieve the expiry for a given CSP Refresh Token
|
||||
.EXAMPLE
|
||||
Get-CSPRefreshTokenExpiry -RefreshToken $RefreshToken
|
||||
#>
|
||||
Param (
|
||||
[Parameter(Mandatory=$true)][String]$RefreshToken
|
||||
)
|
||||
|
||||
$body = @{"tokenValue"="$RefreshToken"}
|
||||
$json = $body | ConvertTo-Json
|
||||
$results = Invoke-WebRequest -Uri "https://console.cloud.vmware.com/csp/gateway/am/api/auth/api-tokens/details" -Method POST -ContentType "application/json" -UseBasicParsing -Body $json
|
||||
$tokenDetails = (($results.Content) | ConvertFrom-Json)
|
||||
|
||||
$createDate = (Get-Date -Date "01/01/1970").AddMilliseconds($tokenDetails.createdAt).ToLocalTime()
|
||||
$usedDate = (Get-Date -Date "01/01/1970").AddMilliseconds($tokenDetails.lastUsedAt).ToLocalTime()
|
||||
$expiryDate = (Get-Date -Date "01/01/1970").AddMilliseconds($tokenDetails.expiresAt).ToLocalTime()
|
||||
|
||||
$tmp = [pscustomobject] @{
|
||||
LastUsedDate = $usedDate;
|
||||
CreatedDate = $createDate;
|
||||
ExpiryDate = $expiryDate;
|
||||
}
|
||||
$tmp | Format-List
|
||||
}
|
||||
123
Modules/VMware.Community.CISTag/VMware.Community.CISTag.psd1
Normal file
123
Modules/VMware.Community.CISTag/VMware.Community.CISTag.psd1
Normal file
@@ -0,0 +1,123 @@
|
||||
#
|
||||
# Module manifest for module 'VMware.Community.CISTag'
|
||||
#
|
||||
# Generated by: Kyle Ruddy
|
||||
#
|
||||
# Generated on: 12/14/18
|
||||
#
|
||||
|
||||
@{
|
||||
|
||||
# Script module or binary module file associated with this manifest.
|
||||
RootModule = 'VMware.Community.CISTag.psm1'
|
||||
|
||||
# Version number of this module.
|
||||
ModuleVersion = '1.0.0'
|
||||
|
||||
# Supported PSEditions
|
||||
# CompatiblePSEditions = @()
|
||||
|
||||
# ID used to uniquely identify this module
|
||||
GUID = 'a0803efd-6017-4049-bfc9-5983a5a0c348'
|
||||
|
||||
# Author of this module
|
||||
Author = 'Kyle Ruddy'
|
||||
|
||||
# Company or vendor of this module
|
||||
CompanyName = 'VMware'
|
||||
|
||||
# Copyright statement for this module
|
||||
Copyright = '(c) VMware. All rights reserved.'
|
||||
|
||||
# Description of the functionality provided by this module
|
||||
Description = 'Community sourced PowerShell Module for managing vSphere Tags via the CIS Endpoint'
|
||||
|
||||
# Minimum version of the PowerShell engine required by this module
|
||||
PowerShellVersion = '4.0'
|
||||
|
||||
# Name of the PowerShell host required by this module
|
||||
# PowerShellHostName = ''
|
||||
|
||||
# Minimum version of the PowerShell host required by this module
|
||||
# PowerShellHostVersion = ''
|
||||
|
||||
# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
|
||||
# DotNetFrameworkVersion = ''
|
||||
|
||||
# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
|
||||
# CLRVersion = ''
|
||||
|
||||
# Processor architecture (None, X86, Amd64) required by this module
|
||||
# ProcessorArchitecture = ''
|
||||
|
||||
# Modules that must be imported into the global environment prior to importing this module
|
||||
# RequiredModules = @()
|
||||
|
||||
# Assemblies that must be loaded prior to importing this module
|
||||
# RequiredAssemblies = @()
|
||||
|
||||
# Script files (.ps1) that are run in the caller's environment prior to importing this module.
|
||||
# ScriptsToProcess = @()
|
||||
|
||||
# Type files (.ps1xml) to be loaded when importing this module
|
||||
# TypesToProcess = @()
|
||||
|
||||
# Format files (.ps1xml) to be loaded when importing this module
|
||||
# FormatsToProcess = @()
|
||||
|
||||
# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
|
||||
# NestedModules = @()
|
||||
|
||||
# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
|
||||
FunctionsToExport = 'Get-CISTag', 'Get-CISTagCategory', 'Get-CISTagAssignment', 'New-CISTag', 'New-CISTagCategory', 'New-CISTagAssignment', 'Remove-CISTag', 'Remove-CISTagCategory', 'Remove-CISTagAssignment'
|
||||
|
||||
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
|
||||
# CmdletsToExport = '*'
|
||||
|
||||
# Variables to export from this module
|
||||
# VariablesToExport = '*'
|
||||
|
||||
# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
|
||||
# AliasesToExport = '*'
|
||||
|
||||
# DSC resources to export from this module
|
||||
# DscResourcesToExport = @()
|
||||
|
||||
# List of all modules packaged with this module
|
||||
# ModuleList = @()
|
||||
|
||||
# List of all files packaged with this module
|
||||
# FileList = @()
|
||||
|
||||
# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
|
||||
PrivateData = @{
|
||||
|
||||
PSData = @{
|
||||
|
||||
# Tags applied to this module. These help with module discovery in online galleries.
|
||||
# Tags = @()
|
||||
|
||||
# A URL to the license for this module.
|
||||
# LicenseUri = ''
|
||||
|
||||
# A URL to the main website for this project.
|
||||
# ProjectUri = ''
|
||||
|
||||
# A URL to an icon representing this module.
|
||||
# IconUri = ''
|
||||
|
||||
# ReleaseNotes of this module
|
||||
# ReleaseNotes = ''
|
||||
|
||||
} # End of PSData hashtable
|
||||
|
||||
} # End of PrivateData hashtable
|
||||
|
||||
# HelpInfo URI of this module
|
||||
# HelpInfoURI = ''
|
||||
|
||||
# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
|
||||
# DefaultCommandPrefix = ''
|
||||
|
||||
}
|
||||
|
||||
770
Modules/VMware.Community.CISTag/VMware.Community.CISTag.psm1
Normal file
770
Modules/VMware.Community.CISTag/VMware.Community.CISTag.psm1
Normal file
@@ -0,0 +1,770 @@
|
||||
function Get-CISTag {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Gathers tag information from the CIS REST API endpoint
|
||||
.DESCRIPTION
|
||||
Will provide a list of tags
|
||||
.NOTES
|
||||
Author: Kyle Ruddy, @kmruddy
|
||||
.PARAMETER Name
|
||||
Tag name which should be retreived
|
||||
.PARAMETER Category
|
||||
Tag category name which should be retreived
|
||||
.PARAMETER Id
|
||||
Tag ID which should be retreived
|
||||
.EXAMPLE
|
||||
Get-CISTag
|
||||
Retreives all tag information
|
||||
.EXAMPLE
|
||||
Get-CISTag -Name tagName
|
||||
Retreives the tag information based on the specified name
|
||||
#>
|
||||
[CmdletBinding(SupportsShouldProcess = $True, ConfirmImpact = 'Low')]
|
||||
param(
|
||||
[Parameter(Mandatory=$false,Position=0,ValueFromPipelineByPropertyName=$true)]
|
||||
[String]$Name,
|
||||
[Parameter(Mandatory=$false,Position=1,ValueFromPipelineByPropertyName=$true)]
|
||||
[String]$Category,
|
||||
[Parameter(Mandatory=$false,Position=2,ValueFromPipelineByPropertyName=$true)]
|
||||
[String]$Id
|
||||
)
|
||||
|
||||
If (-Not $global:DefaultCisServers) { Write-error "No CIS Connection found, please use the Connect-CisServer to connect" } Else {
|
||||
$tagSvc = Get-CisService -Name com.vmware.cis.tagging.tag
|
||||
if ($PSBoundParameters.ContainsKey("Id")) {
|
||||
$tagOutput = $tagSvc.get($Id)
|
||||
} else {
|
||||
if ($global:DefaultVIServer -and $global:DefaultVIServer.Name -eq $global:DefaultCisServers.Name) {
|
||||
[Boolean]$vCenterConn = $true
|
||||
$vCTagList = Get-Tag
|
||||
} else {
|
||||
$tagArray = @()
|
||||
$tagIdList = $tagSvc.list() | Select-Object -ExpandProperty Value
|
||||
[int]$counter = 1
|
||||
foreach ($t in $tagIdList) {
|
||||
$tagArray += $tagSvc.get($t)
|
||||
$counter++
|
||||
if ($counter -gt 200) {Start-Sleep -Milliseconds 1; $counter = 1}
|
||||
}
|
||||
}
|
||||
if ($PSBoundParameters.ContainsKey("Name")) {
|
||||
if ($vCenterConn){
|
||||
$tagOutput = $vCTagList | Where-Object {$_.Name -eq $Name}
|
||||
} else {$tagOutput = $tagArray | Where-Object {$_.Name -eq $Name}}
|
||||
} elseif ($PSBoundParameters.ContainsKey("Category")) {
|
||||
if ($vCenterConn){
|
||||
$tagOutput = $vCTagList | Where-Object {$_.Category -eq $Category}
|
||||
} else {
|
||||
$tagCatid = Get-CISTagCategory -Name $Category | Select-Object -ExpandProperty Id
|
||||
$tagIdList = $tagSvc.list_tags_for_category($tagCatid)
|
||||
$tagArray2 = @()
|
||||
foreach ($t in $tagIdList) {
|
||||
$tagArray2 += $tagSvc.get($t)
|
||||
}
|
||||
$tagOutput = $tagArray2
|
||||
}
|
||||
} else {
|
||||
if ($vCenterConn){$tagOutput = $vCTagList}
|
||||
else {$tagOutput = $tagArray}
|
||||
}
|
||||
}
|
||||
$tagOutput | Select-Object Id, Name, Description
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function New-CISTag {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Creates a new tag from the CIS REST API endpoint
|
||||
.DESCRIPTION
|
||||
Will create a new tag
|
||||
.NOTES
|
||||
Author: Kyle Ruddy, @kmruddy
|
||||
.PARAMETER Name
|
||||
Tag name which should be created
|
||||
.PARAMETER Category
|
||||
Category name where the new tag should be associated
|
||||
.PARAMETER Description
|
||||
Description for the new tag
|
||||
.PARAMETER CategoryID
|
||||
Category ID where the new tag should be associated
|
||||
.EXAMPLE
|
||||
New-CISTag -Name tagName -Category categoryName -Description "Tag Descrition"
|
||||
Creates a new tag based on the specified name
|
||||
#>
|
||||
[CmdletBinding(SupportsShouldProcess = $True, ConfirmImpact = 'Medium')]
|
||||
param(
|
||||
[Parameter(Mandatory=$true,Position=0)]
|
||||
[String]$Name,
|
||||
[Parameter(Mandatory=$false,Position=1)]
|
||||
[String]$Category,
|
||||
[Parameter(Mandatory=$false,Position=2)]
|
||||
[String]$Description,
|
||||
[Parameter(Mandatory=$false,Position=3)]
|
||||
[String]$CategoryID
|
||||
)
|
||||
|
||||
If (-Not $global:DefaultCisServers) { Write-error "No CIS Connection found, please use the Connect-CisServer to connect" } Else {
|
||||
$tagSvc = Get-CisService -Name com.vmware.cis.tagging.tag
|
||||
$tagCreateHelper = $tagSvc.Help.create.create_spec.Create()
|
||||
$tagCreateHelper.name = $Name
|
||||
if ($PSBoundParameters.ContainsKey("Category")) {
|
||||
$tagCreateHelper.category_id = Get-CISTagCategory -Name $Category | Select-Object -ExpandProperty Id
|
||||
} elseif ($PSBoundParameters.ContainsKey("CategoryId")) {
|
||||
$tagCreateHelper.category_id = $CategoryID
|
||||
} else {Write-Warning "No Category input found. Add a Category name or ID."; break}
|
||||
if ($PSBoundParameters.ContainsKey("Description")) {
|
||||
$tagCreateHelper.description = $Description
|
||||
} else {
|
||||
$tagCreateHelper.description = ""
|
||||
}
|
||||
$tagNewId = $tagSvc.create($tagCreateHelper)
|
||||
Get-CISTag -Id $tagNewId
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function Remove-CISTag {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Removes a tag from the CIS REST API endpoint
|
||||
.DESCRIPTION
|
||||
Will delete a new tag
|
||||
.NOTES
|
||||
Author: Kyle Ruddy, @kmruddy
|
||||
.PARAMETER Name
|
||||
Tag name which should be removed
|
||||
.PARAMETER ID
|
||||
Tag ID which should be removed
|
||||
.EXAMPLE
|
||||
Remove-CISTag -Name tagName
|
||||
Removes a new tag based on the specified name
|
||||
#>
|
||||
[CmdletBinding(SupportsShouldProcess = $True, ConfirmImpact = 'High')]
|
||||
param(
|
||||
[Parameter(Mandatory=$false,Position=0,ValueFromPipelineByPropertyName=$true)]
|
||||
[String]$Name,
|
||||
[Parameter(Mandatory=$false,Position=1,ValueFromPipelineByPropertyName=$true)]
|
||||
[String]$ID
|
||||
)
|
||||
|
||||
If (-Not $global:DefaultCisServers) { Write-error "No CIS Connection found, please use the Connect-CisServer to connect" } Else {
|
||||
$tagSvc = Get-CisService -Name com.vmware.cis.tagging.tag
|
||||
if ($ID) {
|
||||
$tagSvc.delete($ID)
|
||||
} else {
|
||||
$tagId = Get-CISTag -Name $Name | select -ExpandProperty Id
|
||||
if ($tagId) {$tagSvc.delete($tagId)}
|
||||
else {Write-Warning "No valid tag found."}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function Get-CISTagCategory {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Gathers tag category information from the CIS REST API endpoint
|
||||
.DESCRIPTION
|
||||
Will provide a list of tag categories
|
||||
.NOTES
|
||||
Author: Kyle Ruddy, @kmruddy
|
||||
.PARAMETER Name
|
||||
Tag category name which should be retreived
|
||||
.PARAMETER Id
|
||||
Tag category ID which should be retreived
|
||||
.EXAMPLE
|
||||
Get-CISTagCategory
|
||||
Retreives all tag category information
|
||||
.EXAMPLE
|
||||
Get-CISTagCategory -Name tagCategoryName
|
||||
Retreives the tag category information based on the specified name
|
||||
#>
|
||||
[CmdletBinding(SupportsShouldProcess = $True, ConfirmImpact = 'Low')]
|
||||
param(
|
||||
[Parameter(Mandatory=$false,Position=0,ValueFromPipelineByPropertyName=$true)]
|
||||
[String]$Name,
|
||||
[Parameter(Mandatory=$false,Position=2,ValueFromPipelineByPropertyName=$true)]
|
||||
[String]$Id
|
||||
)
|
||||
|
||||
If (-Not $global:DefaultCisServers) { Write-error "No CIS Connection found, please use the Connect-CisServer to connect" } Else {
|
||||
$tagCatSvc = Get-CisService -Name com.vmware.cis.tagging.category
|
||||
if ($PSBoundParameters.ContainsKey("Id")) {
|
||||
$tagCatOutput = $tagCatSvc.get($Id)
|
||||
} else {
|
||||
$tagCatArray = @()
|
||||
$tagCatIdList = $tagCatSvc.list() | Select-Object -ExpandProperty Value
|
||||
foreach ($tc in $tagCatIdList) {
|
||||
$tagCatArray += $tagCatSvc.get($tc)
|
||||
}
|
||||
if ($PSBoundParameters.ContainsKey("Name")) {
|
||||
$tagCatOutput = $tagCatArray | Where-Object {$_.Name -eq $Name}
|
||||
} else {
|
||||
$tagCatOutput = $tagCatArray
|
||||
}
|
||||
}
|
||||
$tagCatOutput | Select-Object Id, Name, Description, Cardinality
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function New-CISTagCategory {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Creates a new tag category from the CIS REST API endpoint
|
||||
.DESCRIPTION
|
||||
Will create a new tag category
|
||||
.NOTES
|
||||
Author: Kyle Ruddy, @kmruddy
|
||||
.PARAMETER Name
|
||||
Tag category name which should be created
|
||||
.PARAMETER Description
|
||||
Tag category ID which should be retreived
|
||||
.PARAMETER Cardinality
|
||||
Tag category ID which should be retreived
|
||||
.PARAMETER AssociableTypes
|
||||
Tag category ID which should be retreived
|
||||
.EXAMPLE
|
||||
New-CISTagCategory -Name NewTagCategoryName -Description "New Tag Category Description" -Cardinality "Single" -AssociableTypes
|
||||
Creates a new tag category with the specified information
|
||||
#>
|
||||
[CmdletBinding(SupportsShouldProcess = $True, ConfirmImpact = 'Medium')]
|
||||
param(
|
||||
[Parameter(Mandatory=$true,Position=0)]
|
||||
[String]$Name,
|
||||
[Parameter(Mandatory=$false,Position=1)]
|
||||
[String]$Description,
|
||||
[Parameter(Mandatory=$false,Position=2)]
|
||||
[ValidateSet("SINGLE","MULTIPLE")]
|
||||
[String]$Cardinality = "SINGLE",
|
||||
[Parameter(Mandatory=$false,Position=3)]
|
||||
[ValidateSet("All", "Cluster", "Datacenter", "Datastore", "DatastoreCluster", "DistributedPortGroup", "DistributedSwitch", "Folder", "ResourcePool", "VApp", "VirtualPortGroup", "VirtualMachine", "VMHost")]
|
||||
[String]$AssociableTypes = "All"
|
||||
)
|
||||
|
||||
If (-Not $global:DefaultCisServers) { Write-error "No CIS Connection found, please use the Connect-CisServer to connect" } Else {
|
||||
$tagCatSvc = Get-CisService -Name com.vmware.cis.tagging.category
|
||||
$tagCatCreateHelper = $tagCatSvc.Help.create.create_spec.Create()
|
||||
$tagCatCreateHelper.name = $Name
|
||||
if ($PSBoundParameters.ContainsKey("Description")) {
|
||||
$tagCatCreateHelper.description = $Description
|
||||
} else {$tagCatCreateHelper.description = ""}
|
||||
$tagCatCreateHelper.cardinality = $Cardinality
|
||||
$tagCatCreateAssocTypeHelper = $tagCatSvc.help.create.create_spec.associable_types.create()
|
||||
$tagCatCreateAssocTypeHelper.Add($AssociableTypes)
|
||||
$tagCatCreateHelper.associable_types = $tagCatCreateAssocTypeHelper
|
||||
$tagCatNewId = $tagCatSvc.create($tagCatCreateHelper)
|
||||
Get-CISTagCategory -Id $tagCatNewId
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function Remove-CISTagCategory {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Removes tag category information from the CIS REST API endpoint
|
||||
.DESCRIPTION
|
||||
Will remove a tag category
|
||||
.NOTES
|
||||
Author: Kyle Ruddy, @kmruddy
|
||||
.PARAMETER Name
|
||||
Tag category name which should be removed
|
||||
.PARAMETER Id
|
||||
Tag category ID which should be removed
|
||||
.EXAMPLE
|
||||
Remove-CISTagCategory -Name tagCategoryName
|
||||
Removes the tag category information based on the specified name
|
||||
|
||||
#>
|
||||
[CmdletBinding(SupportsShouldProcess = $True, ConfirmImpact = 'High')]
|
||||
param(
|
||||
[Parameter(Mandatory=$false,Position=0,ValueFromPipelineByPropertyName=$true)]
|
||||
[String]$Name,
|
||||
[Parameter(Mandatory=$false,Position=2,ValueFromPipelineByPropertyName=$true)]
|
||||
[String]$Id
|
||||
)
|
||||
|
||||
If (-Not $global:DefaultCisServers) { Write-error "No CIS Connection found, please use the Connect-CisServer to connect" } Else {
|
||||
$tagCatSvc = Get-CisService -Name com.vmware.cis.tagging.category
|
||||
if ($PSBoundParameters.ContainsKey("Id")) {
|
||||
$tagCatSvc.delete($Id)
|
||||
} elseif ($PSBoundParameters.ContainsKey("Name")) {
|
||||
$tagCatId = Get-CISTagCategory -Name $Name | Select-Object -ExpandProperty Id
|
||||
$tagCatSvc.delete($tagCatId)
|
||||
} else {Write-Warning "No tag category found."}
|
||||
}
|
||||
}
|
||||
|
||||
function Get-CISTagAssignment {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Displays a list of the tag assignments from the CIS REST API endpoint
|
||||
.DESCRIPTION
|
||||
Will provide a list of the tag assignments
|
||||
.NOTES
|
||||
Author: Kyle Ruddy, @kmruddy
|
||||
.PARAMETER Category
|
||||
Tag category name which should be referenced
|
||||
.PARAMETER Entity
|
||||
Object name which should be retreived
|
||||
.PARAMETER ObjectId
|
||||
Object ID which should be retreived
|
||||
.EXAMPLE
|
||||
Get-CISTagAssignment
|
||||
Retreives all tag assignment information
|
||||
.EXAMPLE
|
||||
Get-CISTagAssignment -Entity VMName
|
||||
Retreives all tag assignments for the VM name
|
||||
.EXAMPLE
|
||||
Get-CISTagAssignment -ObjectId 'vm-11'
|
||||
Retreives all tag assignments for the VM object
|
||||
#>
|
||||
[CmdletBinding(SupportsShouldProcess = $True, ConfirmImpact = 'Low')]
|
||||
param(
|
||||
[Parameter(Mandatory=$false,Position=0)]
|
||||
[String]$Category,
|
||||
[Parameter(Mandatory=$false,Position=1)]
|
||||
[String]$Entity,
|
||||
[Parameter(Mandatory=$false,Position=2,ValueFromPipelineByPropertyName=$true)]
|
||||
[String]$ObjectId
|
||||
)
|
||||
|
||||
If (-Not $global:DefaultCisServers) { Write-error "No CIS Connection found, please use the Connect-CisServer to connect" } Else {
|
||||
$tagOutput = @()
|
||||
[Boolean]$vCenterConn = $false
|
||||
$tagAssocSvc = Get-CisService -Name com.vmware.cis.tagging.tag_association
|
||||
if ($PSBoundParameters.ContainsKey("ObjectId")) {
|
||||
if ($ObjectId.split('-')[0] -eq 'vm') {
|
||||
$objType = "VirtualMachine"
|
||||
} elseif ($ObjectId.Split('-')[0] -eq 'datastore') {
|
||||
$objType = 'Datastore'
|
||||
} else {Write-Warning 'Only VirtualMachine and Datastore types currently supported.'; break}
|
||||
$objObject = $tagAssocSvc.help.list_attached_tags.object_id.create()
|
||||
$objObject.id = $ObjectId
|
||||
$objObject.type = $objType
|
||||
$tagIdOutput = $tagAssocSvc.list_attached_tags($objObject)
|
||||
} elseif ($PSBoundParameters.ContainsKey("Entity")) {
|
||||
if ($global:DefaultVIServer -and $global:DefaultVIServer.Name -eq $global:DefaultCisServers.Name) {
|
||||
[Boolean]$vCenterConn = $true
|
||||
$viObject = (Get-Inventory -Name $Entity).ExtensionData.MoRef
|
||||
$objObject = $tagAssocSvc.help.list_attached_tags.object_id.create()
|
||||
$objObject.id = $viObject.Value
|
||||
$objObject.type = $viObject.type
|
||||
} else {
|
||||
$vmSvc = Get-CisService -Name com.vmware.vcenter.vm
|
||||
$filterVmNameObj = $vmsvc.help.list.filter.create()
|
||||
$filterVmNameObj.names.add($Entity) | Out-Null
|
||||
$objId = $vmSvc.list($filterVmNameObj) | Select-Object -ExpandProperty vm
|
||||
if ($objId) {$objType = "VirtualMachine"}
|
||||
else {
|
||||
$dsSvc = Get-CisService com.vmware.vcenter.datastore
|
||||
$filterDsNameObj = $dsSvc.Help.list.filter.Create()
|
||||
$filterDsNameObj.names.add($Entity) | Out-Null
|
||||
$objId = $dsSvc.list($filterDsNameObj) | Select-Object -ExpandProperty datastore
|
||||
if ($objId) {$objType = "Datastore"}
|
||||
else {Write-Warning "No entities found."; break}
|
||||
}
|
||||
$objObject = $tagAssocSvc.help.list_attached_tags.object_id.create()
|
||||
$objObject.id = $objId
|
||||
$objObject.type = $objType
|
||||
}
|
||||
$tagIdOutput = $tagAssocSvc.list_attached_tags($objObject)
|
||||
} else {
|
||||
$tagSvc = Get-CisService -Name com.vmware.cis.tagging.tag
|
||||
$tagIdOutput = @()
|
||||
$tagCategories = Get-CISTagCategory | Sort-Object -Property Name
|
||||
if ($Category) {
|
||||
$tagCatId = $tagCategories | Where-Object {$_.Name -eq $Category} | Select-Object -ExpandProperty Id
|
||||
$tagIdOutput += $tagSvc.list_tags_for_category($tagCatId)
|
||||
} else {
|
||||
foreach ($tagCat in $tagCategories) {
|
||||
$tagIdOutput += $tagSvc.list_tags_for_category($tagCat.id)
|
||||
}
|
||||
}
|
||||
}
|
||||
$tagReference = Get-CISTag
|
||||
|
||||
if ($Entity -or $ObjectId) {
|
||||
foreach ($tagId in $tagIdOutput) {
|
||||
$tagAttObj = @()
|
||||
if ($Entity) {
|
||||
$tagAttObj += $tagAssocSvc.list_attached_objects($tagId) | Where-Object {$_.type -eq $viObject.type -and $_.id -eq $viObject.Value}
|
||||
} else {
|
||||
$tagAttObj += $tagAssocSvc.list_attached_objects($tagId) | Where-Object {$_.id -eq $ObjectId}
|
||||
}
|
||||
foreach ($obj in $tagAttObj) {
|
||||
if ($obj.type -eq "VirtualMachine") {
|
||||
if (-Not $vmSvc) {$vmSvc = Get-CisService -Name com.vmware.vcenter.vm}
|
||||
$filterVmObj = $vmsvc.help.list.filter.create()
|
||||
$filterVmObj.vms.add($obj.Id) | Out-Null
|
||||
$objName = $vmSvc.list($filterVmObj) | Select-Object -ExpandProperty Name
|
||||
} elseif ($obj.type -eq "Datastore") {
|
||||
if (-Not $dsSvc) {$dsSvc = Get-CisService -Name com.vmware.vcenter.datastore}
|
||||
$filterDsObj = $dsSvc.help.list.filter.create()
|
||||
$filterDsObj.datastores.add($obj.Id) | Out-Null
|
||||
$objName = $dsSvc.list($filterDsObj) | Select-Object -ExpandProperty Name
|
||||
} else {$objName = 'Object Not Found'}
|
||||
$tempObject = "" | Select-Object Tag, Entity
|
||||
$tempObject.Tag = $tagReference | Where-Object {$_.id -eq $tagId} | Select-Object -ExpandProperty Name
|
||||
$tempObject.Entity = $objName
|
||||
$tagOutput += $tempObject
|
||||
}
|
||||
}
|
||||
} else {
|
||||
foreach ($tagId in $tagIdOutput) {
|
||||
$tagAttObj = @()
|
||||
$tagAttObj += $tagAssocSvc.list_attached_objects($tagId)
|
||||
if ($global:DefaultVIServer -and $global:DefaultVIServer.Name -eq $global:DefaultCisServers.Name) {
|
||||
[Boolean]$vCenterConn = $true
|
||||
} elseif ($tagAttObj.Type -contains "VirtualMachine") {
|
||||
if (-Not $vmSvc) {$vmSvc = Get-CisService -Name com.vmware.vcenter.vm}
|
||||
} elseif ($tagAttObj.Type -contains "Datastore") {
|
||||
if (-Not $dsSvc) {$dsSvc = Get-CisService -Name com.vmware.vcenter.datastore}
|
||||
}
|
||||
foreach ($obj in $tagAttObj) {
|
||||
if ($vCenterConn) {
|
||||
$newViObj = New-Object -TypeName VMware.Vim.ManagedObjectReference
|
||||
$newViObj.Type = $obj.type
|
||||
$newViObj.Value = $obj.id
|
||||
$objName = Get-View -Id $newViObj -Property Name | Select-Object -ExpandProperty Name
|
||||
} elseif ($obj.type -eq "VirtualMachine") {
|
||||
$filterVmObj = $vmsvc.help.list.filter.create()
|
||||
$filterVmObj.vms.add($obj.Id) | Out-Null
|
||||
$objName = $vmSvc.list($filterVmObj) | Select-Object -ExpandProperty Name
|
||||
} elseif ($obj.type -eq "Datastore") {
|
||||
$filterDsObj = $dsSvc.help.list.filter.create()
|
||||
$filterDsObj.datastores.add($obj.Id) | Out-Null
|
||||
$objName = $dsSvc.list($filterDsObj) | Select-Object -ExpandProperty Name
|
||||
} else {$objName = 'Object Not Found'}
|
||||
$tempObject = "" | Select-Object Tag, Entity
|
||||
$tempObject.Tag = $tagReference | Where-Object {$_.id -eq $tagId} | Select-Object -ExpandProperty Name
|
||||
$tempObject.Entity = $objName
|
||||
$tagOutput += $tempObject
|
||||
}
|
||||
}
|
||||
}
|
||||
return $tagOutput
|
||||
}
|
||||
}
|
||||
|
||||
function New-CISTagAssignment {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Creates new tag assignments from the CIS REST API endpoint
|
||||
.DESCRIPTION
|
||||
Will create new tag assignments
|
||||
.NOTES
|
||||
Author: Kyle Ruddy, @kmruddy
|
||||
.PARAMETER Tag
|
||||
Tag name which should be referenced
|
||||
.PARAMETER Entity
|
||||
Object name which should be retreived
|
||||
.PARAMETER TagId
|
||||
Tag ID/s which should be referenced
|
||||
.PARAMETER ObjectId
|
||||
Object ID which/s should be retreived
|
||||
.EXAMPLE
|
||||
New-CISTagAssignment -Tag TagName -Entity VMName
|
||||
Creates a tag assignment between the Tag name and the VM name
|
||||
.EXAMPLE
|
||||
New-CISTagAssignment -TagId $tagId -ObjectId 'vm-11'
|
||||
Creates a tag assignment between the Tag ID and the Object ID
|
||||
#>
|
||||
[CmdletBinding(SupportsShouldProcess = $True, ConfirmImpact = 'Medium')]
|
||||
param(
|
||||
[Parameter(Mandatory=$false,Position=0)]
|
||||
$Tag,
|
||||
[Parameter(Mandatory=$false,Position=1)]
|
||||
$Entity,
|
||||
[Parameter(Mandatory=$false,Position=2)]
|
||||
$TagId,
|
||||
[Parameter(Mandatory=$false,Position=3)]
|
||||
$ObjectId
|
||||
)
|
||||
|
||||
If (-Not $global:DefaultCisServers) { Write-error "No CIS Connection found, please use the Connect-CisServer to connect" } Else {
|
||||
$tagAssocSvc = Get-CisService -Name com.vmware.cis.tagging.tag_association
|
||||
if ($PSBoundParameters.ContainsKey("Tag") -and $PSBoundParameters.ContainsKey("Entity")) {
|
||||
if ($Tag -is [array] -and $Entity -isnot [array]) {
|
||||
$tagIdList = $tagAssocSvc.help.attach_multiple_tags_to_object.tag_ids.create()
|
||||
foreach ($t in $Tag) {
|
||||
$tempId = Get-CISTag -Name $t | Select-Object -ExpandProperty Id
|
||||
$tagIdList.add($tempId) | Out-Null
|
||||
}
|
||||
if ($global:DefaultVIServer -and $global:DefaultVIServer.Name -eq $global:DefaultCisServers.Name) {
|
||||
$viObject = (Get-Inventory -Name $Entity).ExtensionData.MoRef
|
||||
$objObject = $tagAssocSvc.help.list_attached_tags.object_id.create()
|
||||
$objObject.id = $viObject.Value
|
||||
$objObject.type = $viObject.type
|
||||
} else {
|
||||
if (-Not $vmSvc) {$vmSvc = Get-CisService -Name com.vmware.vcenter.vm}
|
||||
$filterVmNameObj = $vmsvc.help.list.filter.create()
|
||||
$filterVmNameObj.names.add($Entity) | Out-Null
|
||||
$objId = $vmSvc.list($filterVmNameObj) | Select-Object -ExpandProperty vm
|
||||
if ($objId) {$objType = "VirtualMachine"}
|
||||
else {
|
||||
if (-Not $dsSvc) {$dsSvc = Get-CisService -Name com.vmware.vcenter.datastore}
|
||||
$filterDsNameObj = $dsSvc.Help.list.filter.Create()
|
||||
$filterDsNameObj.names.add($Entity) | Out-Null
|
||||
$objId = $dsSvc.list($filterDsNameObj) | Select-Object -ExpandProperty datastore
|
||||
if ($objId) {$objType = "Datastore"}
|
||||
else {Write-Warning "No entities found."; break}
|
||||
}
|
||||
$objObject = $tagAssocSvc.help.list_attached_tags.object_id.create()
|
||||
$objObject.id = $objId
|
||||
$objObject.type = $objType
|
||||
}
|
||||
$tagAssocSvc.attach_multiple_tags_to_object($objObject,$tagIdList) | Out-Null
|
||||
} elseif ($Tag -isnot [array] -and $Entity -is [array]) {
|
||||
$tagId = Get-CISTag -Name $Tag | Select-Object -ExpandProperty Id
|
||||
$objList = $tagAssocSvc.help.attach_tag_to_multiple_objects.object_ids.create()
|
||||
foreach ($e in $Entity) {
|
||||
if ($global:DefaultVIServer -and $global:DefaultVIServer.Name -eq $global:DefaultCisServers.Name) {
|
||||
$viObject = (Get-Inventory -Name $e).ExtensionData.MoRef
|
||||
$objObject = $tagAssocSvc.help.list_attached_tags.object_id.create()
|
||||
$objObject.id = $viObject.Value
|
||||
$objObject.type = $viObject.type
|
||||
} else {
|
||||
if (-Not $vmSvc) {$vmSvc = Get-CisService -Name com.vmware.vcenter.vm}
|
||||
$filterVmNameObj = $vmsvc.help.list.filter.create()
|
||||
$filterVmNameObj.names.add($Entity) | Out-Null
|
||||
$objId = $vmSvc.list($filterVmNameObj) | Select-Object -ExpandProperty vm
|
||||
if ($objId) {$objType = "VirtualMachine"}
|
||||
else {
|
||||
if (-Not $dsSvc) {$dsSvc = Get-CisService -Name com.vmware.vcenter.datastore}
|
||||
$filterDsObj = $dsSvc.help.list.filter.create()
|
||||
$filterDsObj.datastores.add($obj.Id) | Out-Null
|
||||
$objId = $dsSvc.list($filterDsObj) | Select-Object -ExpandProperty Datastore
|
||||
if ($objId) {$objType = "Datastore"}
|
||||
else {Write-Warning "No entities found."; break}
|
||||
}
|
||||
$objObject = $tagAssocSvc.help.list_attached_tags.object_id.create()
|
||||
$objObject.id = $objId
|
||||
$objObject.type = $objType
|
||||
}
|
||||
$objList.add($objObject) | Out-Null
|
||||
}
|
||||
$tagAssocSvc.attach_tag_to_multiple_objects($TagId,$objList) | Out-Null
|
||||
} elseif ($Tag -isnot [array] -and $Entity -isnot [array]) {
|
||||
$tagId = Get-CISTag -Name $Tag | Select-Object -ExpandProperty Id
|
||||
if ($global:DefaultVIServer -and $global:DefaultVIServer.Name -eq $global:DefaultCisServers.Name) {
|
||||
$viObject = (Get-Inventory -Name $Entity).ExtensionData.MoRef
|
||||
$objObject = $tagAssocSvc.help.list_attached_tags.object_id.create()
|
||||
$objObject.id = $viObject.Value
|
||||
$objObject.type = $viObject.type
|
||||
} else {
|
||||
if (-Not $vmSvc) {$vmSvc = Get-CisService -Name com.vmware.vcenter.vm}
|
||||
$filterVmNameObj = $vmsvc.help.list.filter.create()
|
||||
$filterVmNameObj.names.add($Entity) | Out-Null
|
||||
$objId = $vmSvc.list($filterVmNameObj) | Select-Object -ExpandProperty vm
|
||||
if ($objId) {$objType = "VirtualMachine"}
|
||||
else {
|
||||
if (-Not $dsSvc) {$dsSvc = Get-CisService -Name com.vmware.vcenter.datastore}
|
||||
$filterDsNameObj = $dsSvc.Help.list.filter.Create()
|
||||
$filterDsNameObj.names.add($Entity) | Out-Null
|
||||
$objId = $dsSvc.list($filterDsNameObj) | Select-Object -ExpandProperty datastore
|
||||
if ($objId) {$objType = "Datastore"}
|
||||
else {Write-Warning "No entities found."; break}
|
||||
}
|
||||
$objObject = $tagAssocSvc.help.list_attached_tags.object_id.create()
|
||||
$objObject.id = $objId
|
||||
$objObject.type = $objType
|
||||
}
|
||||
$tagAssocSvc.attach($TagId,$objObject) | Out-Null
|
||||
}
|
||||
} elseif ($PSBoundParameters.ContainsKey("TagId") -and $PSBoundParameters.ContainsKey("ObjectId")) {
|
||||
if ($ObjectId.split('-')[0] -eq 'vm') {
|
||||
$objType = "VirtualMachine"
|
||||
} elseif ($ObjectId.Split('-')[0] -eq 'datastore') {
|
||||
$objType = 'Datastore'
|
||||
} else {Write-Warning 'Only VirtualMachine and Datastore types currently supported.'; break}
|
||||
if ($TagId -is [array] -and $ObjectId -isnot [array]) {
|
||||
$objObject = $tagAssocSvc.help.attach_multiple_tags_to_object.object_id.create()
|
||||
$objObject.id = $ObjectId
|
||||
$objObject.type = $objType
|
||||
$tagIdList = $tagAssocSvc.help.attach_multiple_tags_to_object.tag_ids.create()
|
||||
foreach ($tId in $TagId) {
|
||||
$tagIdList.add($tId) | Out-Null
|
||||
}
|
||||
$tagAssocSvc.attach_multiple_tags_to_object($objObject,$tagIdList) | Out-Null
|
||||
} elseif ($TagId -isnot [array] -and $ObjectId -is [array]) {
|
||||
$objList = $tagAssocSvc.help.attach_tag_to_multiple_objects.object_ids.create()
|
||||
foreach ($obj in $ObjectId) {
|
||||
$objObject = $tagAssocSvc.help.attach_tag_to_multiple_objects.object_ids.element.create()
|
||||
$objObject.id = $obj
|
||||
$objObject.type = $objType
|
||||
$objList.add($objObject) | Out-Null
|
||||
}
|
||||
$tagAssocSvc.attach_tag_to_multiple_objects($TagId,$objList) | Out-Null
|
||||
} elseif ($TagId -isnot [array] -and $ObjectId -isnot [array]) {
|
||||
$objObject = $tagAssocSvc.help.attach.object_id.create()
|
||||
$objObject.id = $ObjectId
|
||||
$objObject.type = $objType
|
||||
$tagAssocSvc.attach($TagId,$objObject) | Out-Null
|
||||
}
|
||||
|
||||
} else {Write-Output "Multiple tags with multiple objects are not a supported call."}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function Remove-CISTagAssignment {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Removes a tag assignment from the CIS REST API endpoint
|
||||
.DESCRIPTION
|
||||
Will remove provided tag assignments
|
||||
.NOTES
|
||||
Author: Kyle Ruddy, @kmruddy
|
||||
.PARAMETER Tag
|
||||
Tag name which should be removed
|
||||
.PARAMETER Entity
|
||||
Object name which should be removed
|
||||
.PARAMETER TagId
|
||||
Tag ID/s which should be removed
|
||||
.PARAMETER ObjectId
|
||||
Object ID which/s should be removed
|
||||
.EXAMPLE
|
||||
Remove-CISTagAssignment -TagId $tagId -ObjectId 'vm-11'
|
||||
Removes the tag assignment between the Tag ID and the Object ID
|
||||
.EXAMPLE
|
||||
Remove-CISTagAssignment -Tag TagName -Entity VMName
|
||||
Removes the tag assignment between the Tag name and the Entity name
|
||||
#>
|
||||
[CmdletBinding(SupportsShouldProcess = $True, ConfirmImpact = 'High')]
|
||||
param(
|
||||
[Parameter(Mandatory=$false,Position=0,ValueFromPipelineByPropertyName=$true)]
|
||||
$Tag,
|
||||
[Parameter(Mandatory=$false,Position=1,ValueFromPipelineByPropertyName=$true)]
|
||||
$Entity,
|
||||
[Parameter(Mandatory=$false,Position=2)]
|
||||
$TagId,
|
||||
[Parameter(Mandatory=$false,Position=3)]
|
||||
$ObjectId
|
||||
)
|
||||
|
||||
If (-Not $global:DefaultCisServers) { Write-error "No CIS Connection found, please use the Connect-CisServer to connect" } Else {
|
||||
$tagAssocSvc = Get-CisService -Name com.vmware.cis.tagging.tag_association
|
||||
if ($PSBoundParameters.ContainsKey("Tag") -and $PSBoundParameters.ContainsKey("Entity")) {
|
||||
if ($Tag -is [array] -and $Entity -isnot [array]) {
|
||||
$tagIdList = $tagAssocSvc.help.detach_multiple_tags_from_object.tag_ids.create()
|
||||
foreach ($t in $Tag) {
|
||||
$tempId = Get-CISTag -Name $t | Select-Object -ExpandProperty Id
|
||||
$tagIdList.add($tempId) | Out-Null
|
||||
}
|
||||
if ($global:DefaultVIServer -and $global:DefaultVIServer.Name -eq $global:DefaultCisServers.Name) {
|
||||
$viObject = (Get-Inventory -Name $Entity).ExtensionData.MoRef
|
||||
$objObject = $tagAssocSvc.help.detach_multiple_tags_from_object.object_id.create()
|
||||
$objObject.id = $viObject.Value
|
||||
$objObject.type = $viObject.type
|
||||
} else {
|
||||
$vmSvc = Get-CisService -Name com.vmware.vcenter.vm
|
||||
$filterVmNameObj = $vmsvc.help.list.filter.create()
|
||||
$filterVmNameObj.names.add($Entity) | Out-Null
|
||||
$objId = $vmSvc.list($filterVmNameObj) | Select-Object -ExpandProperty vm
|
||||
if ($objId) {$objType = "VirtualMachine"}
|
||||
else {
|
||||
if (-Not $dsSvc) {$dsSvc = Get-CisService -Name com.vmware.vcenter.datastore}
|
||||
$filterDsNameObj = $dsSvc.Help.list.filter.Create()
|
||||
$filterDsNameObj.names.add($Entity) | Out-Null
|
||||
$objId = $dsSvc.list($filterDsNameObj) | Select-Object -ExpandProperty datastore
|
||||
if ($objId) {$objType = "Datastore"}
|
||||
else {Write-Warning "No entities found."; break}
|
||||
}
|
||||
$objObject = $tagAssocSvc.help.detach_multiple_tags_from_object.object_id.create()
|
||||
$objObject.id = $objId
|
||||
$objObject.type = $objType
|
||||
}
|
||||
$tagAssocSvc.detach_multiple_tags_from_object($objObject,$tagIdList) | Out-Null
|
||||
} elseif ($Tag -isnot [array] -and $Entity -is [array]) {
|
||||
$tagId = Get-CISTag -Name $Tag | Select-Object -ExpandProperty Id
|
||||
$objList = $tagAssocSvc.help.detach_tag_from_multiple_objects.object_ids.create()
|
||||
foreach ($e in $Entity) {
|
||||
if ($global:DefaultVIServer -and $global:DefaultVIServer.Name -eq $global:DefaultCisServers.Name) {
|
||||
$viObject = (Get-Inventory -Name $e).ExtensionData.MoRef
|
||||
$objObject = $tagAssocSvc.help.detach_tag_from_multiple_objects.object_ids.element.create()
|
||||
$objObject.id = $viObject.Value
|
||||
$objObject.type = $viObject.type
|
||||
} else {
|
||||
$vmSvc = Get-CisService -Name com.vmware.vcenter.vm
|
||||
$filterVmNameObj = $vmsvc.help.list.filter.create()
|
||||
$filterVmNameObj.names.add($Entity) | Out-Null
|
||||
$objId = $vmSvc.list($filterVmNameObj) | Select-Object -ExpandProperty vm
|
||||
if ($objId) {$objType = "VirtualMachine"}
|
||||
else {
|
||||
if (-Not $dsSvc) {$dsSvc = Get-CisService -Name com.vmware.vcenter.datastore}
|
||||
$filterDsNameObj = $dsSvc.Help.list.filter.Create()
|
||||
$filterDsNameObj.names.add($Entity) | Out-Null
|
||||
$objId = $dsSvc.list($filterDsNameObj) | Select-Object -ExpandProperty datastore
|
||||
if ($objId) {$objType = "Datastore"}
|
||||
else {Write-Warning "No entities found."; break}
|
||||
}
|
||||
$objObject = $tagAssocSvc.help.detach_tag_from_multiple_objects.object_ids.element.create()
|
||||
$objObject.id = $objId
|
||||
$objObject.type = $objType
|
||||
}
|
||||
$objList.add($objObject) | Out-Null
|
||||
}
|
||||
$tagAssocSvc.detach_tag_from_multiple_objects($TagId,$objList) | Out-Null
|
||||
} elseif ($Tag -isnot [array] -and $Entity -isnot [array]) {
|
||||
$tagId = Get-CISTag -Name $Tag | Select-Object -ExpandProperty Id
|
||||
if ($global:DefaultVIServer -and $global:DefaultVIServer.Name -eq $global:DefaultCisServers.Name) {
|
||||
$viObject = (Get-Inventory -Name $Entity).ExtensionData.MoRef
|
||||
$objObject = $tagAssocSvc.help.detach.object_id.create()
|
||||
$objObject.id = $viObject.Value
|
||||
$objObject.type = $viObject.type
|
||||
} else {
|
||||
$vmSvc = Get-CisService -Name com.vmware.vcenter.vm
|
||||
$filterVmNameObj = $vmsvc.help.list.filter.create()
|
||||
$filterVmNameObj.names.add($Entity) | Out-Null
|
||||
$objId = $vmSvc.list($filterVmNameObj) | Select-Object -ExpandProperty vm
|
||||
if ($objId) {$objType = "VirtualMachine"}
|
||||
else {
|
||||
if (-Not $dsSvc) {$dsSvc = Get-CisService -Name com.vmware.vcenter.datastore}
|
||||
$filterDsNameObj = $dsSvc.Help.list.filter.Create()
|
||||
$filterDsNameObj.names.add($Entity) | Out-Null
|
||||
$objId = $dsSvc.list($filterDsNameObj) | Select-Object -ExpandProperty datastore
|
||||
if ($objId) {$objType = "Datastore"}
|
||||
else {Write-Warning "No entities found."; break}
|
||||
}
|
||||
$objObject = $tagAssocSvc.help.detach.object_id.create()
|
||||
$objObject.id = $objId
|
||||
$objObject.type = $objType
|
||||
}
|
||||
$tagAssocSvc.detach($TagId,$objObject) | Out-Null
|
||||
}
|
||||
} elseif ($PSBoundParameters.ContainsKey("TagId") -and $PSBoundParameters.ContainsKey("ObjectId")) {
|
||||
if ($ObjectId.split('-')[0] -eq 'vm') {
|
||||
$objType = "VirtualMachine"
|
||||
} elseif ($ObjectId.Split('-')[0] -eq 'datastore') {
|
||||
$objType = 'Datastore'
|
||||
}else {Write-Warning 'Only VirtualMachine types currently supported.'; break}
|
||||
if ($TagId -is [array] -and $ObjectId -isnot [array]) {
|
||||
$objObject = $tagAssocSvc.help.detach_multiple_tags_from_object.object_id.create()
|
||||
$objObject.id = $ObjectId
|
||||
$objObject.type = $objType
|
||||
$tagIdList = $tagAssocSvc.help.detach_multiple_tags_from_object.tag_ids.create()
|
||||
foreach ($tId in $TagId) {
|
||||
$tagIdList.add($tId) | Out-Null
|
||||
}
|
||||
$tagAssocSvc.detach_multiple_tags_from_object($objObject,$tagIdList) | Out-Null
|
||||
} elseif ($TagId -isnot [array] -and $ObjectId -is [array]) {
|
||||
$objList = $tagAssocSvc.help.detach_tag_from_multiple_objects.object_ids.create()
|
||||
foreach ($obj in $ObjectId) {
|
||||
$objObject = $tagAssocSvc.help.detach_tag_from_multiple_objects.object_ids.element.create()
|
||||
$objObject.id = $obj
|
||||
$objObject.type = $objType
|
||||
$objList.add($objObject) | Out-Null
|
||||
}
|
||||
$tagAssocSvc.detach_tag_from_multiple_objects($TagId,$objList) | Out-Null
|
||||
} elseif ($TagId -isnot [array] -and $ObjectId -isnot [array]) {
|
||||
$objObject = $tagAssocSvc.help.detach.object_id.create()
|
||||
$objObject.id = $ObjectId
|
||||
$objObject.type = $objType
|
||||
$tagAssocSvc.detach($TagId,$objObject) | Out-Null
|
||||
}
|
||||
} else {Write-Output "Multiple tags with multiple objects are not a supported call."}
|
||||
|
||||
}
|
||||
}
|
||||
BIN
Modules/VMware.DRaaS/VMware.DRaaS.psd1
Executable file
BIN
Modules/VMware.DRaaS/VMware.DRaaS.psd1
Executable file
Binary file not shown.
256
Modules/VMware.DRaaS/VMware.DRaaS.psm1
Normal file
256
Modules/VMware.DRaaS/VMware.DRaaS.psm1
Normal file
@@ -0,0 +1,256 @@
|
||||
Function Connect-DRaas {
|
||||
<#
|
||||
.NOTES
|
||||
===========================================================================
|
||||
Created by: William Lam
|
||||
Date: 05/23/2019
|
||||
Organization: VMware
|
||||
Blog: http://www.virtuallyghetto.com
|
||||
Twitter: @lamw
|
||||
===========================================================================
|
||||
|
||||
.SYNOPSIS
|
||||
This cmdlet creates $global:draasConnection object containing the DRaaS URL along with CSP Token Header
|
||||
.DESCRIPTION
|
||||
This cmdlet creates $global:draasConnection object containing the DRaaS URL along with CSP Token Header
|
||||
.EXAMPLE
|
||||
Connect-DRaaS -RefreshToken $RefreshToken -OrgName $OrgName -SDDCName $SDDCName
|
||||
.NOTES
|
||||
You must be logged into VMC using Connect-VmcServer cmdlet
|
||||
#>
|
||||
Param (
|
||||
[Parameter(Mandatory=$true)][String]$RefreshToken,
|
||||
[Parameter(Mandatory=$true)][String]$OrgName,
|
||||
[Parameter(Mandatory=$true)][String]$SDDCName
|
||||
)
|
||||
|
||||
If (-Not $global:DefaultVMCServers.IsConnected) { Write-error "No valid VMC Connection found, please use the Connect-VMC to connect"; break } Else {
|
||||
$sddcService = Get-VmcService "com.vmware.vmc.orgs.sddcs"
|
||||
$orgId = (Get-VMCOrg -Name $OrgName).Id
|
||||
$sddcId = (Get-VMCSDDC -Name $SDDCName -Org $OrgName).Id
|
||||
$sddc = $sddcService.get($orgId,$sddcId)
|
||||
|
||||
}
|
||||
|
||||
$results = Invoke-WebRequest -Uri "https://console.cloud.vmware.com/csp/gateway/am/api/auth/api-tokens/authorize" -Method POST -Headers @{accept='application/json'} -Body "refresh_token=$RefreshToken"
|
||||
if($results.StatusCode -ne 200) {
|
||||
Write-Host -ForegroundColor Red "Failed to retrieve Access Token, please ensure your VMC Refresh Token is valid and try again"
|
||||
break
|
||||
}
|
||||
$accessToken = ($results | ConvertFrom-Json).access_token
|
||||
|
||||
$headers = @{
|
||||
"csp-auth-token"="$accessToken"
|
||||
"Content-Type"="application/json"
|
||||
"Accept"="application/json"
|
||||
}
|
||||
$global:draasConnection = new-object PSObject -Property @{
|
||||
'Server' = "https://vmc.vmware.com/vmc/draas/api/orgs/$orgId/sddcs/$sddcId/site-recovery"
|
||||
'headers' = $headers
|
||||
}
|
||||
$global:draasConnection
|
||||
}
|
||||
|
||||
Function Get-DRaas {
|
||||
<#
|
||||
.NOTES
|
||||
===========================================================================
|
||||
Created by: William Lam
|
||||
Date: 05/23/2019
|
||||
Organization: VMware
|
||||
Blog: http://www.virtuallyghetto.com
|
||||
Twitter: @lamw
|
||||
===========================================================================
|
||||
|
||||
.SYNOPSIS
|
||||
Returns information about DRaaS configuration for a given SDDC
|
||||
.DESCRIPTION
|
||||
This cmdlet returns information about DRaaS configuration for a given SDDC. Can be used to monitor both activate and deactivate operations.
|
||||
.EXAMPLE
|
||||
Get-DRaas
|
||||
#>
|
||||
Param (
|
||||
[Switch]$Troubleshoot
|
||||
)
|
||||
|
||||
If (-Not $global:draasConnection) { Write-error "No DRaaS Connection found, please use Connect-DRaaS" } Else {
|
||||
$method = "GET"
|
||||
$draasUrl = $global:draasConnection.Server
|
||||
$draasVersionUrl = $global:draasConnection.Server + "/versions"
|
||||
|
||||
if($Troubleshoot) {
|
||||
Write-Host -ForegroundColor cyan "`n[DEBUG] - $METHOD`n$draasUrl`n"
|
||||
}
|
||||
|
||||
try {
|
||||
if($PSVersionTable.PSEdition -eq "Core") {
|
||||
$requests = Invoke-WebRequest -Uri $draasUrl -Method $method -Headers $global:draasConnection.headers -SkipCertificateCheck
|
||||
} else {
|
||||
$requests = Invoke-WebRequest -Uri $draasUrl -Method $method -Headers $global:draasConnection.headers
|
||||
}
|
||||
} catch {
|
||||
if($_.Exception.Response.StatusCode -eq "Unauthorized") {
|
||||
Write-Host -ForegroundColor Red "`nThe CSP session is no longer valid, please re-run the Connect-DRaaS cmdlet to retrieve a new token`n"
|
||||
break
|
||||
} else {
|
||||
Write-Error "Error in retrieving DRaaS Information"
|
||||
Write-Error "`n($_.Exception.Message)`n"
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if($requests.StatusCode -eq 200) {
|
||||
$json = ($requests.Content | ConvertFrom-Json)
|
||||
|
||||
$draasId = $json.id;
|
||||
$draasState = $json.site_recovery_state;
|
||||
$srmNode = $json.srm_node.ip_address;
|
||||
$srmNodeState = $json.site_recovery_state;
|
||||
$vrNode = $json.vr_node.ip_address;
|
||||
$vrNodeState = $json.vr_node.state;
|
||||
$draasUrl = $json.draas_h5_url;
|
||||
|
||||
if($srmNodeState -eq "ACTIVATED") {
|
||||
if($Troubleshoot) {
|
||||
Write-Host -ForegroundColor cyan "`n[DEBUG] - $METHOD`n$draasVersionUrl`n"
|
||||
}
|
||||
|
||||
try {
|
||||
if($PSVersionTable.PSEdition -eq "Core") {
|
||||
$requests = Invoke-WebRequest -Uri $draasVersionUrl -Method $method -Headers $global:draasConnection.headers -SkipCertificateCheck
|
||||
} else {
|
||||
$requests = Invoke-WebRequest -Uri $draasVersionUrl -Method $method -Headers $global:draasConnection.headers
|
||||
}
|
||||
} catch {
|
||||
if($_.Exception.Response.StatusCode -eq "Unauthorized") {
|
||||
Write-Host -ForegroundColor Red "`nThe CSP session is no longer valid, please re-run the Connect-DRaaS cmdlet to retrieve a new token`n"
|
||||
break
|
||||
} else {
|
||||
Write-Error "Error in retrieving DRaaS Information"
|
||||
Write-Error "`n($_.Exception.Message)`n"
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if($requests.StatusCode -eq 200) {
|
||||
$json = ($requests.Content | ConvertFrom-Json).node_versions
|
||||
|
||||
$srmVersion,$srmDescription = ($json | where {$_.node_ip -eq $srmNode}).full_version.split("`n")
|
||||
$vrVersion,$vrDescription = ($json | where {$_.node_ip -eq $vrNode}).full_version.split("`n")
|
||||
|
||||
$results = [pscustomobject] @{
|
||||
ID = $draasId;
|
||||
DRaaSState = $draasState;
|
||||
SRMNode = $srmNode;
|
||||
SRMVersion = $srmVersion;
|
||||
SRMNodeState = $srmNodeState;
|
||||
VRNode = $vrNode;
|
||||
VRVersion = $vrVersion;
|
||||
VRNodeState = $vrNodeState;
|
||||
DRaaSURL = $draasUrl;
|
||||
}
|
||||
|
||||
$results
|
||||
}
|
||||
} elseif ($srmNodeState -eq "ACTIVATING" -or $srmNodeState -eq "DEACTIVATING") {
|
||||
$results = [pscustomobject] @{
|
||||
ID = $draasId;
|
||||
DRaaSState = $draasState;
|
||||
SRMNode = $srmNode;
|
||||
SRMNodeState = $srmNodeState;
|
||||
VRNode = $vrNode;
|
||||
VRNodeState = $vrNodeState;
|
||||
DRaaSURL = $draasUrl;
|
||||
}
|
||||
|
||||
$results
|
||||
} else {
|
||||
Write-Host "`nDRaaS is currently deactivated, please run Set-DRaas -Activate`n"
|
||||
}
|
||||
} else {
|
||||
Write-Host "`nDRaaS has not been activated before, please run Set-DRaas -Activate`n"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Function Set-DRaas {
|
||||
<#
|
||||
.NOTES
|
||||
===========================================================================
|
||||
Created by: William Lam
|
||||
Date: 05/23/2019
|
||||
Organization: VMware
|
||||
Blog: http://www.virtuallyghetto.com
|
||||
Twitter: @lamw
|
||||
===========================================================================
|
||||
|
||||
.SYNOPSIS
|
||||
Activate or deactivate DRaaS for a given SDDC
|
||||
.DESCRIPTION
|
||||
This cmdlet activates or deactivates DRaaS for a given SDDC
|
||||
.EXAMPLE
|
||||
Get-DRaas
|
||||
#>
|
||||
Param (
|
||||
[Switch]$Activate,
|
||||
[Switch]$Deactivate,
|
||||
[Switch]$Troubleshoot
|
||||
)
|
||||
|
||||
If (-Not $global:draasConnection) { Write-error "No DRaaS Connection found, please use Connect-DRaaS" } Else {
|
||||
$draasUrl = $global:draasConnection.server
|
||||
|
||||
if($Activate) {
|
||||
$method = "POST"
|
||||
|
||||
if($Troubleshoot) {
|
||||
Write-Host -ForegroundColor cyan "`n[DEBUG] - $METHOD`n$draasUrl`n"
|
||||
}
|
||||
|
||||
try {
|
||||
if($PSVersionTable.PSEdition -eq "Core") {
|
||||
$requests = Invoke-WebRequest -Uri $draasUrl -Method $method -Headers $global:draasConnection.headers -SkipCertificateCheck
|
||||
} else {
|
||||
$requests = Invoke-WebRequest -Uri $draasUrl -Method $method -Headers $global:draasConnection.headers
|
||||
}
|
||||
} catch {
|
||||
if($_.Exception.Response.StatusCode -eq "Unauthorized") {
|
||||
Write-Host -ForegroundColor Red "`nThe CSP session is no longer valid, please re-run the Connect-DRaaS cmdlet to retrieve a new token`n"
|
||||
break
|
||||
} else {
|
||||
Write-Error "Error in activating DRaaS"
|
||||
Write-Error "`n($_.Exception.Message)`n"
|
||||
break
|
||||
}
|
||||
}
|
||||
Write-Host "`nActivating DRaaS, this will take some time and you can monitor the progress using Get-DRaaS or using the VMC Console UI`n"
|
||||
} elseif ($Deactivate) {
|
||||
$method = "DELETE"
|
||||
|
||||
if($Troubleshoot) {
|
||||
Write-Host -ForegroundColor cyan "`n[DEBUG] - $METHOD`n$draasUrl`n"
|
||||
}
|
||||
|
||||
try {
|
||||
if($PSVersionTable.PSEdition -eq "Core") {
|
||||
$requests = Invoke-WebRequest -Uri $draasUrl -Method $method -Headers $global:draasConnection.headers -SkipCertificateCheck
|
||||
} else {
|
||||
$requests = Invoke-WebRequest -Uri $draasUrl -Method $method -Headers $global:draasConnection.headers
|
||||
}
|
||||
} catch {
|
||||
if($_.Exception.Response.StatusCode -eq "Unauthorized") {
|
||||
Write-Host -ForegroundColor Red "`nThe CSP session is no longer valid, please re-run the Connect-DRaaS cmdlet to retrieve a new token`n"
|
||||
break
|
||||
} else {
|
||||
Write-Error "Error in deactivating DRaaS"
|
||||
Write-Error "`n($_.Exception.Message)`n"
|
||||
break
|
||||
}
|
||||
}
|
||||
Write-Host "`nDeactivating DRaaS, this will take some time and you can monitor the progress using Get-DRaaS or the VMC Console UI`n"
|
||||
} else {
|
||||
Write-Error "Invalid Operation"
|
||||
}
|
||||
}
|
||||
}
|
||||
93
Modules/VMware.HCX/VMware.HCX.psd1
Normal file
93
Modules/VMware.HCX/VMware.HCX.psd1
Normal file
@@ -0,0 +1,93 @@
|
||||
#
|
||||
# Module manifest for module 'VMware.HCX'
|
||||
#
|
||||
# Generated by: wlam@vmware.com
|
||||
#
|
||||
# Generated on: 09/11/18
|
||||
#
|
||||
|
||||
@{
|
||||
|
||||
# Script module or binary module file associated with this manifest.
|
||||
RootModule = 'VMware.HCX.psm1'
|
||||
|
||||
# Version number of this module.
|
||||
ModuleVersion = '1.0.2'
|
||||
|
||||
# Supported PSEditions
|
||||
# CompatiblePSEditions = @()
|
||||
|
||||
# ID used to uniquely identify this module
|
||||
GUID = '88898ed6-26e8-4dfa-a9de-10d3a12571de'
|
||||
|
||||
# Author of this module
|
||||
Author = 'William Lam'
|
||||
|
||||
# Company or vendor of this module
|
||||
CompanyName = 'VMware'
|
||||
|
||||
# Copyright statement for this module
|
||||
Copyright = '(c) 2018 VMware. All rights reserved.'
|
||||
|
||||
# Description of the functionality provided by this module
|
||||
Description = 'PowerShell Module for Managing Hybrid Cloud Extension (HCX) on VMware Cloud on AWS'
|
||||
|
||||
# Minimum version of the Windows PowerShell engine required by this module
|
||||
PowerShellVersion = '6.0'
|
||||
|
||||
# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
|
||||
|
||||
FunctionsToExport = 'Connect-HcxServer', 'Get-HcxCloudConfig', 'Get-HcxEndpoint', 'New-HcxMigration', 'Get-HcxMigration', 'Connect-HcxVAMI',
|
||||
'Get-HcxVCConfig', 'Set-HcxLicense', 'Set-HcxVCConfig', 'Get-HcxNSXConfig', 'Set-HcxNSXConfig', 'Get-HcxCity', 'Get-HcxLocation', 'Set-HcxLocation',
|
||||
'Get-HcxRoleMapping', 'Set-HcxRoleMapping', 'Get-HcxProxy', 'Set-HcxProxy', 'Remove-HcxProxy', 'Connect-HcxCloudServer', 'Get-HCXCloudActivationKey',
|
||||
'Get-HCXCloudSubscription', 'New-HCXCloudActivationKey', 'Get-HCXCloud', 'Set-HCXCloud'
|
||||
|
||||
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
|
||||
CmdletsToExport = @()
|
||||
|
||||
# Variables to export from this module
|
||||
VariablesToExport = '*'
|
||||
|
||||
# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
|
||||
AliasesToExport = @()
|
||||
|
||||
# DSC resources to export from this module
|
||||
# DscResourcesToExport = @()
|
||||
|
||||
# List of all modules packaged with this module
|
||||
# ModuleList = @()
|
||||
|
||||
# List of all files packaged with this module
|
||||
# FileList = @()
|
||||
|
||||
# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
|
||||
PrivateData = @{
|
||||
|
||||
PSData = @{
|
||||
|
||||
# Tags applied to this module. These help with module discovery in online galleries.
|
||||
# Tags = @()
|
||||
|
||||
# A URL to the license for this module.
|
||||
# LicenseUri = ''
|
||||
|
||||
# A URL to the main website for this project.
|
||||
# ProjectUri = ''
|
||||
|
||||
# A URL to an icon representing this module.
|
||||
# IconUri = ''
|
||||
|
||||
# ReleaseNotes of this module
|
||||
# ReleaseNotes = ''
|
||||
|
||||
} # End of PSData hashtable
|
||||
|
||||
} # End of PrivateData hashtable
|
||||
|
||||
# HelpInfo URI of this module
|
||||
# HelpInfoURI = ''
|
||||
|
||||
# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
|
||||
# DefaultCommandPrefix = ''
|
||||
|
||||
}
|
||||
1702
Modules/VMware.HCX/VMware.HCX.psm1
Normal file
1702
Modules/VMware.HCX/VMware.HCX.psm1
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,97 @@
|
||||
{
|
||||
"Type": "AUTOMATED",
|
||||
"Data": {
|
||||
"Name": "LCFarmJson",
|
||||
"DisplayName": "FarmJsonTest",
|
||||
"AccessGroup": "Root",
|
||||
"Description": "created LC Farm from PS via JSON with NVIDIA GRID VGPU",
|
||||
"Enabled": null,
|
||||
"Deleting": false,
|
||||
"Settings": {
|
||||
"DisconnectedSessionTimeoutPolicy": "NEVER",
|
||||
"DisconnectedSessionTimeoutMinutes": 1,
|
||||
"EmptySessionTimeoutPolicy": "AFTER",
|
||||
"EmptySessionTimeoutMinutes": 1,
|
||||
"LogoffAfterTimeout": false
|
||||
},
|
||||
"Desktop": null,
|
||||
"DisplayProtocolSettings": {
|
||||
"DefaultDisplayProtocol": "PCOIP",
|
||||
"AllowDisplayProtocolOverride": false,
|
||||
"EnableHTMLAccess": false,
|
||||
"EnableCollaboration": false,
|
||||
"EnableGRIDvGPUs": true,
|
||||
"VGPUGridProfile": "grid_m10-8a"
|
||||
},
|
||||
"ServerErrorThreshold": null,
|
||||
"MirageConfigurationOverrides": {
|
||||
"OverrideGlobalSetting": false,
|
||||
"Enabled": false,
|
||||
"Url": null
|
||||
}
|
||||
},
|
||||
"AutomatedFarmSpec": {
|
||||
"ProvisioningType": "VIEW_COMPOSER",
|
||||
"VirtualCenter": null,
|
||||
"RdsServerNamingSpec": {
|
||||
"NamingMethod": "PATTERN",
|
||||
"PatternNamingSettings": {
|
||||
"NamingPattern": "LCFarmVMPS",
|
||||
"MaxNumberOfRDSServers": 1
|
||||
}
|
||||
},
|
||||
"VirtualCenterProvisioningSettings": {
|
||||
"EnableProvisioning": true,
|
||||
"StopProvisioningOnError": true,
|
||||
"MinReadyVMsOnVComposerMaintenance": 0,
|
||||
"VirtualCenterProvisioningData": {
|
||||
"ParentVm": "RDSServer",
|
||||
"Snapshot": "RDS_SNAP1",
|
||||
"Datacenter": null,
|
||||
"VmFolder": "Praveen",
|
||||
"HostOrCluster": "CS-1",
|
||||
"ResourcePool": "CS-1"
|
||||
},
|
||||
"VirtualCenterStorageSettings": {
|
||||
"Datastores": [
|
||||
{
|
||||
"Datastore": "Datastore1",
|
||||
"StorageOvercommit": "UNBOUNDED"
|
||||
}
|
||||
],
|
||||
"UseVSan": false,
|
||||
"ViewComposerStorageSettings": {
|
||||
"UseSeparateDatastoresReplicaAndOSDisks": false,
|
||||
"ReplicaDiskDatastore": null,
|
||||
"UseNativeSnapshots": false,
|
||||
"SpaceReclamationSettings": {
|
||||
"ReclaimVmDiskSpace": false,
|
||||
"ReclamationThresholdGB": null,
|
||||
"BlackoutTimes": null
|
||||
}
|
||||
}
|
||||
},
|
||||
"VirtualCenterNetworkingSettings": {
|
||||
"Nics": null
|
||||
}
|
||||
},
|
||||
"VirtualCenterManagedCommonSettings": {
|
||||
"TransparentPageSharingScope": "VM"
|
||||
},
|
||||
"CustomizationSettings": {
|
||||
"CustomizationType": "SYS_PREP",
|
||||
"DomainAdministrator": null,
|
||||
"AdContainer": "CN=Computers",
|
||||
"ReusePreExistingAccounts": false,
|
||||
"SysprepCustomizationSettings": {
|
||||
"CustomizationSpec": "PraveenCust"
|
||||
}
|
||||
},
|
||||
"RdsServerMaxSessionsData": {
|
||||
"MaxSessionsType": "UNLIMITED",
|
||||
"MaxSessions": null
|
||||
}
|
||||
},
|
||||
"ManualFarmSpec": null,
|
||||
"NetBiosName": "adviewdev"
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
Prerequisites/Steps to use this module:
|
||||
# Prerequisites/Steps to use this module
|
||||
|
||||
1. This module only works for Horizon product E.g. Horizon 7.0.2 and later.
|
||||
2. Install the latest version of Powershell, PowerCLI(6.5) or (later version via psgallery).
|
||||
@@ -6,15 +6,24 @@ Prerequisites/Steps to use this module:
|
||||
4. Import "VMware.Hv.Helper" module by running: Import-Module -Name "location of this module" or Get-Module -ListAvailable 'VMware.Hv.Helper' | Import-Module.
|
||||
5. Get-Command -Module "This module Name" to list all available functions or Get-Command -Module 'VMware.Hv.Helper'.
|
||||
|
||||
# Example script to connect view API service of Connection Server:
|
||||
# Example script to connect ViewAPI service
|
||||
|
||||
```
|
||||
Import-Module VMware.VimAutomation.HorizonView
|
||||
|
||||
# Connection to view API service
|
||||
$hvServer = Connect-HVServer -server <connection server IP/FQDN>
|
||||
$hvServices = $hvserver.ExtensionData
|
||||
|
||||
# List Connection Servers
|
||||
$csList = $hvServices.ConnectionServer.ConnectionServer_List()
|
||||
```
|
||||
# Load this module
|
||||
```
|
||||
Get-Module -ListAvailable 'VMware.Hv.Helper' | Import-Module
|
||||
Get-Command -Module 'VMware.Hv.Helper'
|
||||
```
|
||||
# Use advanced functions of this module
|
||||
```
|
||||
New-HVPool -spec 'path to InstantClone.json file'
|
||||
```
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
# RootModule = ''
|
||||
|
||||
# Version number of this module.
|
||||
ModuleVersion = '1.1'
|
||||
ModuleVersion = '1.3.1'
|
||||
|
||||
# ID used to uniquely identify this module
|
||||
GUID = '6d3f7fb5-4e52-43d8-91e1-f65f72532a1d'
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
188
Modules/VMware.Hv.Helper/docs/Add-HVDesktop.md
Executable file
188
Modules/VMware.Hv.Helper/docs/Add-HVDesktop.md
Executable file
@@ -0,0 +1,188 @@
|
||||
---
|
||||
external help file: VMware.HV.Helper-help.xml
|
||||
Module Name: VMware.HV.Helper
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Add-HVDesktop
|
||||
|
||||
## SYNOPSIS
|
||||
Adds virtual machine to existing pool
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```
|
||||
Add-HVDesktop [-PoolName] <String> [-Machines] <String[]> [[-Users] <String[]>] [[-Vcenter] <String>]
|
||||
[[-HvServer] <Object>] [-WhatIf] [-Confirm] [<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
The Add-HVDesktop adds virtual machines to already exiting pools by using view API service object(hvServer) of Connect-HVServer cmdlet.
|
||||
VMs can be added to any of unmanaged manual, managed manual or Specified name.
|
||||
This advanced function do basic checks for pool and view API service connection existance, hvServer object is bound to specific connection server.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### EXAMPLE 1
|
||||
```
|
||||
Add-HVDesktop -PoolName 'ManualPool' -Machines 'manualPool1', 'manualPool2' -Confirm:$false
|
||||
```
|
||||
|
||||
Add managed manual VMs to existing manual pool
|
||||
|
||||
### EXAMPLE 2
|
||||
```
|
||||
Add-HVDesktop -PoolName 'SpecificNamed' -Machines 'vm-01', 'vm-02' -Users 'user1', 'user2'
|
||||
```
|
||||
|
||||
Add virtual machines to automated specific named dedicated pool
|
||||
|
||||
### EXAMPLE 3
|
||||
```
|
||||
Add-HVDesktop -PoolName 'SpecificNamed' -Machines 'vm-03', 'vm-04'
|
||||
```
|
||||
|
||||
Add machines to automated specific named Floating pool
|
||||
|
||||
### EXAMPLE 4
|
||||
```
|
||||
Add-HVDesktop -PoolName 'Unmanaged' -Machines 'desktop-1.eng.vmware.com'
|
||||
```
|
||||
|
||||
Add machines to unmanged manual pool
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -PoolName
|
||||
Pool name to which new VMs are to be added.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Machines
|
||||
List of virtual machine names which need to be added to the given pool.
|
||||
|
||||
```yaml
|
||||
Type: String[]
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 2
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Users
|
||||
List of virtual machine users for given machines.
|
||||
|
||||
```yaml
|
||||
Type: String[]
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 3
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Vcenter
|
||||
Virtual Center server-address (IP or FQDN) of the given pool.
|
||||
This should be same as provided to the Connection Server while adding the vCenter server.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 4
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -HvServer
|
||||
View API service object of Connect-HVServer cmdlet.
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 5
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -WhatIf
|
||||
Shows what would happen if the cmdlet runs.
|
||||
The cmdlet is not run.
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases: wi
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Confirm
|
||||
Prompts you for confirmation before running the cmdlet.
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases: cf
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
## NOTES
|
||||
|
||||
| | |
|
||||
|-|-|
|
||||
| Author | Praveen Mathamsetty |
|
||||
| Author email | pmathamsetty@vmware.com |
|
||||
| Version | 1.1 |
|
||||
| Dependencies | Make sure pool already exists before adding VMs to it. |
|
||||
|
||||
|
||||
### Tested Against Environment
|
||||
| | |
|
||||
|-|-|
|
||||
| Horizon View Server Version | 7.0.2, 7.1.0 |
|
||||
| PowerCLI Version | PowerCLI 6.5, PowerCLI 6.5.1 |
|
||||
| PowerShell Version | 5.0 |
|
||||
|
||||
## RELATED LINKS
|
||||
138
Modules/VMware.Hv.Helper/docs/Add-HVRDSServer.md
Executable file
138
Modules/VMware.Hv.Helper/docs/Add-HVRDSServer.md
Executable file
@@ -0,0 +1,138 @@
|
||||
---
|
||||
external help file: VMware.HV.Helper-help.xml
|
||||
Module Name: VMware.HV.Helper
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Add-HVRDSServer
|
||||
|
||||
## SYNOPSIS
|
||||
Add RDS Servers to an existing farm.
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```
|
||||
Add-HVRDSServer [-FarmName] <Object> [-RdsServers] <String[]> [[-HvServer] <Object>] [-WhatIf] [-Confirm]
|
||||
[<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
The Add-HVRDSServer adds RDS Servers to already exiting farms by using view API service object(hvServer) of Connect-HVServer cmdlet.
|
||||
We can add RDSServers to manual farm type only.
|
||||
This advanced function do basic checks for farm and view API service connection existance.
|
||||
This hvServer is bound to specific connection server.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### EXAMPLE 1
|
||||
```
|
||||
Add-HVRDSServer -Farm "manualFarmTest" -RdsServers "vm-for-rds","vm-for-rds-2" -Confirm:$false
|
||||
```
|
||||
|
||||
Add RDSServers to manual farm
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -FarmName
|
||||
farm name to which new RDSServers are to be added.
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -RdsServers
|
||||
RDS servers names which need to be added to the given farm.
|
||||
Provide a comma separated list for multiple names.
|
||||
|
||||
```yaml
|
||||
Type: String[]
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 2
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -HvServer
|
||||
View API service object of Connect-HVServer cmdlet.
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 3
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -WhatIf
|
||||
Shows what would happen if the cmdlet runs.
|
||||
The cmdlet is not run.
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases: wi
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Confirm
|
||||
Prompts you for confirmation before running the cmdlet.
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases: cf
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### None
|
||||
|
||||
## NOTES
|
||||
| | |
|
||||
|-|-|
|
||||
| Author | praveen mathamsetty. |
|
||||
| Author email | pmathamsetty@vmware.com |
|
||||
| Version | 1.1 |
|
||||
| Dependencies | Make sure farm already exists before adding RDSServers to it. |
|
||||
|
||||
### Tested Against Environment
|
||||
| | |
|
||||
|-|-|
|
||||
| Horizon View Server Version | 7.0.2, 7.1.0 |
|
||||
| PowerCLI Version | PowerCLI 6.5, PowerCLI 6.5.1 |
|
||||
| PowerShell Version | 5.0 |
|
||||
|
||||
## RELATED LINKS
|
||||
100
Modules/VMware.Hv.Helper/docs/Clear-HVEventDatabase.md
Executable file
100
Modules/VMware.Hv.Helper/docs/Clear-HVEventDatabase.md
Executable file
@@ -0,0 +1,100 @@
|
||||
---
|
||||
external help file: VMware.HV.Helper-help.xml
|
||||
Module Name: VMware.HV.Helper
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Clear-HVEventDatabase
|
||||
|
||||
## SYNOPSIS
|
||||
Clears configurationof the configured Event Database
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```
|
||||
Clear-HVEventDatabase [[-HvServer] <Object>] [-WhatIf] [-Confirm] [<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
Clears configurationof the configured Event Database
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### EXAMPLE 1
|
||||
```
|
||||
Clear-HVEventDatabase
|
||||
```
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -HvServer
|
||||
Reference to Horizon View Server to query the virtual machines from.
|
||||
If the value is not passed or null then
|
||||
first element from global:DefaultHVServers would be considered in-place of hvServer
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -WhatIf
|
||||
Shows what would happen if the cmdlet runs.
|
||||
The cmdlet is not run.
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases: wi
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Confirm
|
||||
Prompts you for confirmation before running the cmdlet.
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases: cf
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
## NOTES
|
||||
| | |
|
||||
|-|-|
|
||||
| Author | Wouter Kursten |
|
||||
| Author email | wouter@retouw.nl |
|
||||
| Version | 1.0 |
|
||||
|
||||
===Tested Against Environment====
|
||||
| | |
|
||||
|-|-|
|
||||
| Horizon View Server Version | 7.4 |
|
||||
| PowerCLI Version | PowerCLI 10 |
|
||||
| PowerShell Version | 5.0 |
|
||||
|
||||
## RELATED LINKS
|
||||
127
Modules/VMware.Hv.Helper/docs/Connect-HVEvent.md
Executable file
127
Modules/VMware.Hv.Helper/docs/Connect-HVEvent.md
Executable file
@@ -0,0 +1,127 @@
|
||||
---
|
||||
external help file: VMware.HV.Helper-help.xml
|
||||
Module Name: VMware.HV.Helper
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Connect-HVEvent
|
||||
|
||||
## SYNOPSIS
|
||||
This function is used to connect to the event database configured on Connection Server.
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```
|
||||
Connect-HVEvent [[-DbPassword] <SecureString>] [[-HvServer] <Object>] [[-DbUserName] <String>]
|
||||
[<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
This function queries the specified Connection Server for event database configuration and returns the connection object to it.
|
||||
If event database is not configured on specified connection server, it will return null.
|
||||
Currently, Horizon 7 is supporting SQL server and Oracle 12c as event database servers.
|
||||
To configure event database, goto 'Event Database Configuration' tab in Horizon admin UI.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### EXAMPLE 1
|
||||
```
|
||||
Connect-HVEvent -HvServer $hvServer
|
||||
```
|
||||
|
||||
Connecting to the database with default username configured on Connection Server $hvServer.
|
||||
|
||||
### EXAMPLE 2
|
||||
```
|
||||
$hvDbServer = Connect-HVEvent -HvServer $hvServer -DbUserName 'system'
|
||||
```
|
||||
|
||||
Connecting to the database configured on Connection Server $hvServer with customised user name 'system'.
|
||||
|
||||
### EXAMPLE 3
|
||||
```
|
||||
$hvDbServer = Connect-HVEvent -HvServer $hvServer -DbUserName 'system' -DbPassword 'censored'
|
||||
```
|
||||
|
||||
Connecting to the database with customised user name and password.
|
||||
|
||||
### EXAMPLE 4
|
||||
```
|
||||
$password = Read-Host 'Database Password' -AsSecureString
|
||||
```
|
||||
|
||||
$hvDbServer = Connect-HVEvent -HvServer $hvServer -DbUserName 'system' -DbPassword $password
|
||||
Connecting to the database with customised user name and password, with password being a SecureString.
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -DbPassword
|
||||
Password corresponds to 'dbUserName' user.
|
||||
|
||||
```yaml
|
||||
Type: SecureString
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -HvServer
|
||||
View API service object of Connect-HVServer cmdlet.
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 2
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -DbUserName
|
||||
User name to be used in database connection.
|
||||
If not passed, default database user name on the Connection Server will be used.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 3
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### Returns a custom object that has database connection as 'dbConnection' property.
|
||||
## NOTES
|
||||
| | |
|
||||
|-|-|
|
||||
| Author | Paramesh Oddepally. |
|
||||
| Author email | poddepally@vmware.com |
|
||||
| Version | 1.1 |
|
||||
|
||||
===Tested Against Environment====
|
||||
| | |
|
||||
|-|-|
|
||||
| Horizon View Server Version | 7.0.2, 7.1.0 |
|
||||
| PowerCLI Version | PowerCLI 6.5, PowerCLI 6.5.1 |
|
||||
| PowerShell Version | 5.0 |
|
||||
|
||||
## RELATED LINKS
|
||||
71
Modules/VMware.Hv.Helper/docs/Disconnect-HVEvent.md
Executable file
71
Modules/VMware.Hv.Helper/docs/Disconnect-HVEvent.md
Executable file
@@ -0,0 +1,71 @@
|
||||
---
|
||||
external help file: VMware.HV.Helper-help.xml
|
||||
Module Name: VMware.HV.Helper
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Disconnect-HVEvent
|
||||
|
||||
## SYNOPSIS
|
||||
This function is used to disconnect the database connection.
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```
|
||||
Disconnect-HVEvent [-HvDbServer] <PSObject> [<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
This function will disconnect the database connection made earlier during Connect-HVEvent function.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### EXAMPLE 1
|
||||
```
|
||||
Disconnect-HVEvent -HvDbServer $hvDbServer
|
||||
```
|
||||
|
||||
Disconnecting the database connection on $hvDbServer.
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -HvDbServer
|
||||
Connection object returned by Connect-HVEvent advanced function.
|
||||
This is a mandatory input.
|
||||
|
||||
```yaml
|
||||
Type: PSObject
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### None
|
||||
## NOTES
|
||||
| | |
|
||||
|-|-|
|
||||
| Author | Paramesh Oddepally. |
|
||||
| Author email | poddepally@vmware.com |
|
||||
| Version | 1.1 |
|
||||
|
||||
===Tested Against Environment====
|
||||
| | |
|
||||
|-|-|
|
||||
| Horizon View Server Version | 7.0.2, 7.1.0 |
|
||||
| PowerCLI Version | PowerCLI 6.5, PowerCLI 6.5.1 |
|
||||
| PowerShell Version | 5.0 |
|
||||
|
||||
## RELATED LINKS
|
||||
110
Modules/VMware.Hv.Helper/docs/Get-HVApplication.md
Executable file
110
Modules/VMware.Hv.Helper/docs/Get-HVApplication.md
Executable file
@@ -0,0 +1,110 @@
|
||||
---
|
||||
external help file: VMware.HV.Helper-help.xml
|
||||
Module Name: VMware.HV.Helper
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Get-HVApplication
|
||||
|
||||
## SYNOPSIS
|
||||
Gets the application information.
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```
|
||||
Get-HVApplication [[-ApplicationName] <String>] [[-HvServer] <Object>] [[-FormatList] <String>]
|
||||
[<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
Gets the application information.
|
||||
This will be useful to find out whether the specified application exists or not.
|
||||
If the application name is not specified, this will lists all the applications in the Pod.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### EXAMPLE 1
|
||||
```
|
||||
Get-HVApplication -ApplicationName 'App1' -HvServer $HvServer
|
||||
```
|
||||
|
||||
Queries and returns 'App1' information.
|
||||
|
||||
### EXAMPLE 2
|
||||
```
|
||||
Get-HVApplication -HvServer $HvServer -FormatList:$True
|
||||
```
|
||||
|
||||
Lists all the applications in the Pod.
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -ApplicationName
|
||||
Name of the application.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -HvServer
|
||||
View API service object of Connect-HVServer cmdlet.
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 2
|
||||
Default value: None
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -FormatList
|
||||
Displays the list of the available applications in Table Format if this parameter is set to True.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 3
|
||||
Default value: False
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### Returns the information of the specified application if it specified, else displays all the available applications.
|
||||
## NOTES
|
||||
| | |
|
||||
|-|-|
|
||||
| Author | Samiullasha S |
|
||||
| Author email | ssami@vmware.com |
|
||||
| Version | 1.2 |
|
||||
|
||||
===Tested Against Environment====
|
||||
| | |
|
||||
|-|-|
|
||||
| Horizon View Server Version | 7.8.0 |
|
||||
| PowerCLI Version | PowerCLI 11.1 |
|
||||
| PowerShell Version | 5.0 |
|
||||
|
||||
## RELATED LINKS
|
||||
143
Modules/VMware.Hv.Helper/docs/Get-HVBaseImageVM.md
Executable file
143
Modules/VMware.Hv.Helper/docs/Get-HVBaseImageVM.md
Executable file
@@ -0,0 +1,143 @@
|
||||
---
|
||||
external help file: VMware.HV.Helper-help.xml
|
||||
Module Name: VMware.HV.Helper
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Get-HVBaseImageVM
|
||||
|
||||
## SYNOPSIS
|
||||
Gets a list of compatible base image virtual machines.
|
||||
|
||||
## SYNTAX
|
||||
|
||||
### Type (Default)
|
||||
```
|
||||
Get-HVBaseImageVM [-HvServer <Object>] [-VirtualCenter <Object>] [-Type <Object>] [<CommonParameters>]
|
||||
```
|
||||
|
||||
### Name
|
||||
```
|
||||
Get-HVBaseImageVM [-HvServer <Object>] [-VirtualCenter <Object>] [-Name <String>] [<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
Queries and returns BaseImageVmInfo for the specified vCenter Server.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### EXAMPLE 1
|
||||
```
|
||||
Get-HVBaseImageVM -VirtualCenter 'vCenter1' -Type VDI
|
||||
```
|
||||
|
||||
### EXAMPLE 2
|
||||
```
|
||||
Get-HVBaseImageVM -VirtualCenter $vCenter1 -Type ALL
|
||||
```
|
||||
|
||||
### EXAMPLE 3
|
||||
```
|
||||
Get-HVBaseImageVM -Name '*WIN10*'
|
||||
```
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -HvServer
|
||||
Reference to Horizon View Server to query the virtual machines from.
|
||||
If the value is not passed or null then
|
||||
first element from global:DefaultHVServers would be considered in place of hvServer.
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -VirtualCenter
|
||||
A parameter to specify which vCenter Server to check base image VMs for.
|
||||
It can be specified as a String,
|
||||
containing the name of the vCenter, or as a vCenter object as returned by Get-HVvCenterServer.
|
||||
If the value is
|
||||
not passed or null then first element returned from Get-HVvCenterServer would be considered in place of VirtualCenter.
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Type
|
||||
A parameter to define the type of compatability to check the base image VM list against.
|
||||
Valid options are 'VDI', 'RDS', or 'ALL'
|
||||
'VDI' will return all desktop compatible Base Image VMs.
|
||||
'RDS' will return all RDSH compatible Base Image VMs.
|
||||
'ALL' will return all Base Image VMs, regardless of compatibility.
|
||||
The default value is 'ALL'.
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: Type
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: VDI
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Name
|
||||
The name of a virtual machine (if known), to filter Base Image VMs on.
|
||||
Wildcards are accepted.
|
||||
If Name is specified, then Type
|
||||
is not considered for filtering.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: Name
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### Returns array of object type VMware.Hv.BaseImageVmInfo
|
||||
## NOTES
|
||||
| | |
|
||||
|-|-|
|
||||
| Author | Matt Frey. |
|
||||
| Author email | mfrey@vmware.com |
|
||||
| Version | 1.0 |
|
||||
|
||||
===Tested Against Environment====
|
||||
| | |
|
||||
|-|-|
|
||||
| Horizon View Server Version | 7.7 |
|
||||
| PowerCLI Version | PowerCLI 11.2.0 |
|
||||
| PowerShell Version | 5.1 |
|
||||
|
||||
## RELATED LINKS
|
||||
154
Modules/VMware.Hv.Helper/docs/Get-HVEntitlement.md
Executable file
154
Modules/VMware.Hv.Helper/docs/Get-HVEntitlement.md
Executable file
@@ -0,0 +1,154 @@
|
||||
---
|
||||
external help file: VMware.HV.Helper-help.xml
|
||||
Module Name: VMware.HV.Helper
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Get-HVEntitlement
|
||||
|
||||
## SYNOPSIS
|
||||
Gets association data between a user/group and a resource
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```
|
||||
Get-HVEntitlement [[-User] <String>] [[-Type] <String>] [[-ResourceName] <String>] [[-ResourceType] <String>]
|
||||
[[-HvServer] <Object>] [<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
Provides entitlement Info between a single user/group and a resource that they can be assigned.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### EXAMPLE 1
|
||||
```
|
||||
Get-HVEntitlement -ResourceType Application
|
||||
```
|
||||
|
||||
Gets all the entitlements related to application pool
|
||||
|
||||
### EXAMPLE 2
|
||||
```
|
||||
Get-HVEntitlement -User 'adviewdev.eng.vmware.com\administrator' -ResourceName 'calculator' -ResourceType Application
|
||||
```
|
||||
|
||||
Gets entitlements specific to user or group name and application resource
|
||||
|
||||
### EXAMPLE 3
|
||||
```
|
||||
Get-HVEntitlement -User 'adviewdev.eng.vmware.com\administrator' -ResourceName 'UrlSetting1' -ResourceType URLRedirection
|
||||
```
|
||||
|
||||
Gets entitlements specific to user or group and URLRedirection resource
|
||||
|
||||
### EXAMPLE 4
|
||||
```
|
||||
Get-HVEntitlement -User 'administrator@adviewdev.eng.vmware.com' -ResourceName 'GE1' -ResourceType GlobalEntitlement
|
||||
```
|
||||
|
||||
Gets entitlements specific to user or group and GlobalEntitlement resource
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -User
|
||||
User principal name of user or group
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Type
|
||||
Whether or not this is a group or a user.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 2
|
||||
Default value: User
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -ResourceName
|
||||
The resource(Application, Desktop etc.) name.
|
||||
Supports only wildcard character '*' when resource type is desktop.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 3
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -ResourceType
|
||||
Type of Resource(Application, Desktop etc.)
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 4
|
||||
Default value: Desktop
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -HvServer
|
||||
Reference to Horizon View Server.
|
||||
If the value is not passed or null then
|
||||
first element from global:DefaultHVServers would be considered in-place of hvServer
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 5
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
## NOTES
|
||||
| | |
|
||||
|-|-|
|
||||
| Author | Praveen Mathamsetty. |
|
||||
| Author email | pmathamsetty@vmware.com |
|
||||
| Version | 1.1 |
|
||||
|
||||
===Tested Against Environment====
|
||||
| | |
|
||||
|-|-|
|
||||
| Horizon View Server Version | 7.0.2, 7.1.0 |
|
||||
| PowerCLI Version | PowerCLI 6.5, PowerCLI 6.5.1 |
|
||||
| PowerShell Version | 5.0 |
|
||||
|
||||
## RELATED LINKS
|
||||
201
Modules/VMware.Hv.Helper/docs/Get-HVEvent.md
Executable file
201
Modules/VMware.Hv.Helper/docs/Get-HVEvent.md
Executable file
@@ -0,0 +1,201 @@
|
||||
---
|
||||
external help file: VMware.HV.Helper-help.xml
|
||||
Module Name: VMware.HV.Helper
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Get-HVEvent
|
||||
|
||||
## SYNOPSIS
|
||||
Queries the events from event database configured on Connection Server.
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```
|
||||
Get-HVEvent [-HvDbServer] <PSObject> [[-TimePeriod] <String>] [[-FilterType] <String>] [[-UserFilter] <String>]
|
||||
[[-SeverityFilter] <String>] [[-TimeFilter] <String>] [[-ModuleFilter] <String>] [[-MessageFilter] <String>]
|
||||
[<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
This function is used to query the events information from event database.
|
||||
It returns the object that has events in five columns as UserName, Severity, EventTime, Module and Message.
|
||||
EventTime will show the exact time when the event got registered in the database and it follows timezone on database server.
|
||||
User can apply different filters on the event columns using the filter parameters userFilter, severityFilter, timeFilter, moduleFilter, messageFilter.
|
||||
Mention that when multiple filters are provided then rows which satisify all the filters will be returned.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### EXAMPLE 1
|
||||
```
|
||||
$e = Get-HVEvent -hvDbServer $hvDbServer
|
||||
```
|
||||
|
||||
$e.Events
|
||||
Querying all the database events on database $hvDbServer.
|
||||
|
||||
### EXAMPLE 2
|
||||
```
|
||||
$e = Get-HVEvent -HvDbServer $hvDbServer -TimePeriod 'all' -FilterType 'startsWith' -UserFilter 'aduser' -SeverityFilter 'err' -TimeFilter 'HH:MM:SS.fff' -ModuleFilter 'broker' -MessageFilter 'aduser'
|
||||
```
|
||||
|
||||
$e.Events | Export-Csv -Path 'myEvents.csv' -NoTypeInformation
|
||||
Querying all the database events where user name startswith 'aduser', severity is of 'err' type, having module name as 'broker', message starting with 'aduser' and time starting with 'HH:MM:SS.fff'.
|
||||
The resulting events will be exported to a csv file 'myEvents.csv'.
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -HvDbServer
|
||||
Connection object returned by Connect-HVEvent advanced function.
|
||||
|
||||
```yaml
|
||||
Type: PSObject
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -TimePeriod
|
||||
Timeperiod of the events that user is interested in.
|
||||
It can take following four values:
|
||||
'day' - Lists last one day events from database
|
||||
'week' - Lists last 7 days events from database
|
||||
'month' - Lists last 30 days events from database
|
||||
'all' - Lists all the events stored in database
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 2
|
||||
Default value: All
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -FilterType
|
||||
Type of filter action to be applied.
|
||||
The parameters userfilter, severityfilter, timefilter, modulefilter, messagefilter can be used along with this.
|
||||
It can take following values:
|
||||
'contains' - Retrieves the events that contains the string specified in filter parameters
|
||||
'startsWith' - Retrieves the events that starts with the string specified in filter parameters
|
||||
'isExactly' - Retrieves the events that exactly match with the string specified in filter parameters
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 3
|
||||
Default value: Contains
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -UserFilter
|
||||
String that can applied in filtering on 'UserName' column.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 4
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -SeverityFilter
|
||||
String that can applied in filtering on 'Severity' column.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 5
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -TimeFilter
|
||||
String that can applied in filtering on 'EventTime' column.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 6
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -ModuleFilter
|
||||
String that can applied in filtering on 'Module' column.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 7
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -MessageFilter
|
||||
String that can applied in filtering on 'Message' column.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 8
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### Returns a custom object that has events information in 'Events' property. Events property will have events information with five columns: UserName, Severity, EventTime, Module and Message.
|
||||
## NOTES
|
||||
| | |
|
||||
|-|-|
|
||||
| Author | Paramesh Oddepally. |
|
||||
| Author email | poddepally@vmware.com |
|
||||
| Version | 1.1 |
|
||||
|
||||
===Tested Against Environment====
|
||||
| | |
|
||||
|-|-|
|
||||
| Horizon View Server Version | 7.0.2, 7.1.0 |
|
||||
| PowerCLI Version | PowerCLI 6.5, PowerCLI 6.5.1 |
|
||||
| PowerShell Version | 5.0 |
|
||||
|
||||
## RELATED LINKS
|
||||
69
Modules/VMware.Hv.Helper/docs/Get-HVEventDatabase.md
Executable file
69
Modules/VMware.Hv.Helper/docs/Get-HVEventDatabase.md
Executable file
@@ -0,0 +1,69 @@
|
||||
---
|
||||
external help file: VMware.HV.Helper-help.xml
|
||||
Module Name: VMware.HV.Helper
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Get-HVEventDatabase
|
||||
|
||||
## SYNOPSIS
|
||||
Retreives information about the configured Event Database
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```
|
||||
Get-HVEventDatabase [[-HvServer] <Object>] [<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
Collects information about the configured event database for aHorizon View pod
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### EXAMPLE 1
|
||||
```
|
||||
Get-HVEventDatabase
|
||||
```
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -HvServer
|
||||
Reference to Horizon View Server to query the virtual machines from.
|
||||
If the value is not passed or null then
|
||||
first element from global:DefaultHVServers would be considered in-place of hvServer
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
## NOTES
|
||||
| | |
|
||||
|-|-|
|
||||
| Author | Wouter Kursten |
|
||||
| Author email | wouter@retouw.nl |
|
||||
| Version | 1.0 |
|
||||
|
||||
===Tested Against Environment====
|
||||
| | |
|
||||
|-|-|
|
||||
| Horizon View Server Version | 7.4 |
|
||||
| PowerCLI Version | PowerCLI 10 |
|
||||
| PowerShell Version | 5.0 |
|
||||
|
||||
## RELATED LINKS
|
||||
179
Modules/VMware.Hv.Helper/docs/Get-HVFarm.md
Executable file
179
Modules/VMware.Hv.Helper/docs/Get-HVFarm.md
Executable file
@@ -0,0 +1,179 @@
|
||||
---
|
||||
external help file: VMware.HV.Helper-help.xml
|
||||
Module Name: VMware.HV.Helper
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Get-HVFarm
|
||||
|
||||
## SYNOPSIS
|
||||
This function is used to find farms based on the search criteria provided by the user.
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```
|
||||
Get-HVFarm [[-FarmName] <String>] [[-FarmDisplayName] <String>] [[-FarmType] <String>] [[-Enabled] <Boolean>]
|
||||
[[-SuppressInfo] <Boolean>] [[-HvServer] <Object>] [<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
This function queries the specified Connection Server for farms which are configured on the server.
|
||||
If no farm is configured on the specified connection server or no farm matches the given search criteria, it will return null.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### EXAMPLE 1
|
||||
```
|
||||
Get-HVFarm -FarmName 'Farm-01'
|
||||
```
|
||||
|
||||
Queries and returns farmInfo based on given parameter farmName
|
||||
|
||||
### EXAMPLE 2
|
||||
```
|
||||
Get-HVFarm -FarmName 'Farm-01' -FarmDisplayName 'Sales RDS Farm'
|
||||
```
|
||||
|
||||
Queries and returns farmInfo based on given parameters farmName, farmDisplayName
|
||||
|
||||
### EXAMPLE 3
|
||||
```
|
||||
Get-HVFarm -FarmName 'Farm-01' -FarmType 'MANUAL'
|
||||
```
|
||||
|
||||
Queries and returns farmInfo based on given parameters farmName, farmType
|
||||
|
||||
### EXAMPLE 4
|
||||
```
|
||||
Get-HVFarm -FarmName 'Farm-01' -FarmType 'MANUAL' -Enabled $true
|
||||
```
|
||||
|
||||
Queries and returns farmInfo based on given parameters farmName, FarmType etc
|
||||
|
||||
### EXAMPLE 5
|
||||
```
|
||||
Get-HVFarm -FarmName 'Farm-0*'
|
||||
```
|
||||
|
||||
Queries and returns farmInfo based on parameter farmName with wild character *
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -FarmName
|
||||
farmName to be searched
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -FarmDisplayName
|
||||
farmDisplayName to be searched
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 2
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -FarmType
|
||||
farmType to be searched.
|
||||
It can take following values:
|
||||
"AUTOMATED" - search for automated farms only
|
||||
'MANUAL' - search for manual farms only
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 3
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Enabled
|
||||
search for farms which are enabled
|
||||
|
||||
```yaml
|
||||
Type: Boolean
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 4
|
||||
Default value: False
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -SuppressInfo
|
||||
Suppress text info, when no farm found with given search parameters
|
||||
|
||||
```yaml
|
||||
Type: Boolean
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 5
|
||||
Default value: False
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -HvServer
|
||||
Reference to Horizon View Server to query the data from.
|
||||
If the value is not passed or null then first element from global:DefaultHVServers would be considered in-place of hvServer.
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 6
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### Returns the list of FarmInfo object matching the query criteria.
|
||||
## NOTES
|
||||
| | |
|
||||
|-|-|
|
||||
| Author | praveen mathamsetty. |
|
||||
| Author email | pmathamsetty@vmware.com |
|
||||
| Version | 1.1 |
|
||||
|
||||
===Tested Against Environment====
|
||||
| | |
|
||||
|-|-|
|
||||
| Horizon View Server Version | 7.0.2, 7.1.0 |
|
||||
| PowerCLI Version | PowerCLI 6.5, PowerCLI 6.5.1 |
|
||||
| PowerShell Version | 5.0 |
|
||||
|
||||
## RELATED LINKS
|
||||
179
Modules/VMware.Hv.Helper/docs/Get-HVFarmSummary.md
Executable file
179
Modules/VMware.Hv.Helper/docs/Get-HVFarmSummary.md
Executable file
@@ -0,0 +1,179 @@
|
||||
---
|
||||
external help file: VMware.HV.Helper-help.xml
|
||||
Module Name: VMware.HV.Helper
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Get-HVFarmSummary
|
||||
|
||||
## SYNOPSIS
|
||||
This function is used to find farms based on the search criteria provided by the user.
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```
|
||||
Get-HVFarmSummary [[-FarmName] <String>] [[-FarmDisplayName] <String>] [[-FarmType] <String>]
|
||||
[[-Enabled] <Boolean>] [[-SuppressInfo] <Boolean>] [[-HvServer] <Object>] [<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
This function queries the specified Connection Server for farms which are configured on the server.
|
||||
If no farm is configured on the specified connection server or no farm matches the given search criteria, it will return null.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### EXAMPLE 1
|
||||
```
|
||||
Get-HVFarmSummary -FarmName 'Farm-01'
|
||||
```
|
||||
|
||||
Queries and returns farmSummary objects based on given parameter farmName
|
||||
|
||||
### EXAMPLE 2
|
||||
```
|
||||
Get-HVFarmSummary -FarmName 'Farm-01' -FarmDisplayName 'Sales RDS Farm'
|
||||
```
|
||||
|
||||
Queries and returns farmSummary objects based on given parameters farmName, farmDisplayName
|
||||
|
||||
### EXAMPLE 3
|
||||
```
|
||||
Get-HVFarmSummary -FarmName 'Farm-01' -FarmType 'MANUAL'
|
||||
```
|
||||
|
||||
Queries and returns farmSummary objects based on given parameters farmName, farmType
|
||||
|
||||
### EXAMPLE 4
|
||||
```
|
||||
Get-HVFarmSummary -FarmName 'Farm-01' -FarmType 'MANUAL' -Enabled $true
|
||||
```
|
||||
|
||||
Queries and returns farmSummary objects based on given parameters farmName, FarmType etc
|
||||
|
||||
### EXAMPLE 5
|
||||
```
|
||||
Get-HVFarmSummary -FarmName 'Farm-0*'
|
||||
```
|
||||
|
||||
Queries and returns farmSummary objects based on given parameter farmName with wild character *
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -FarmName
|
||||
FarmName to be searched
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -FarmDisplayName
|
||||
FarmDisplayName to be searched
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 2
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -FarmType
|
||||
FarmType to be searched.
|
||||
It can take following values:
|
||||
"AUTOMATED" - search for automated farms only
|
||||
'MANUAL' - search for manual farms only
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 3
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Enabled
|
||||
Search for farms which are enabled
|
||||
|
||||
```yaml
|
||||
Type: Boolean
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 4
|
||||
Default value: False
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -SuppressInfo
|
||||
Suppress text info, when no farm found with given search parameters
|
||||
|
||||
```yaml
|
||||
Type: Boolean
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 5
|
||||
Default value: False
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -HvServer
|
||||
Reference to Horizon View Server to query the data from.
|
||||
If the value is not passed or null then first element from global:DefaultHVServers would be considered in-place of hvServer.
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 6
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### Returns the list of FarmSummary object matching the query criteria.
|
||||
## NOTES
|
||||
| | |
|
||||
|-|-|
|
||||
| Author | Praveen Mathamsetty. |
|
||||
| Author email | pmathamsetty@vmware.com |
|
||||
| Version | 1.1 |
|
||||
|
||||
===Tested Against Environment====
|
||||
| | |
|
||||
|-|-|
|
||||
| Horizon View Server Version | 7.0.2, 7.1.0 |
|
||||
| PowerCLI Version | PowerCLI 6.5, PowerCLI 6.5.1 |
|
||||
| PowerShell Version | 5.0 |
|
||||
|
||||
## RELATED LINKS
|
||||
118
Modules/VMware.Hv.Helper/docs/Get-HVGlobalEntitlement.md
Executable file
118
Modules/VMware.Hv.Helper/docs/Get-HVGlobalEntitlement.md
Executable file
@@ -0,0 +1,118 @@
|
||||
---
|
||||
external help file: VMware.HV.Helper-help.xml
|
||||
Module Name: VMware.HV.Helper
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Get-HVGlobalEntitlement
|
||||
|
||||
## SYNOPSIS
|
||||
Gets Global Entitlement(s) with given search parameters.
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```
|
||||
Get-HVGlobalEntitlement [[-DisplayName] <String>] [[-Description] <String>] [[-SuppressInfo] <Boolean>]
|
||||
[[-HvServer] <Object>] [<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
Queries and returns global entitlement(s) and global application entitlement(s).
|
||||
Global entitlements are used to route users to their resources across multiple pods.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### EXAMPLE 1
|
||||
```
|
||||
Get-HVGlobalEntitlement -DisplayName 'GEAPP'
|
||||
```
|
||||
|
||||
Retrieves global application/desktop entitlement(s) with displayName 'GEAPP'
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -DisplayName
|
||||
Display Name of Global Entitlement.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Description
|
||||
Description of Global Entitlement.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 2
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -SuppressInfo
|
||||
Suppress text info, when no global entitlement(s) found with given search parameters
|
||||
|
||||
```yaml
|
||||
Type: Boolean
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 3
|
||||
Default value: False
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -HvServer
|
||||
Reference to Horizon View Server.
|
||||
If the value is not passed or null then
|
||||
first element from global:DefaultHVServers would be considered in-place of hvServer
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 4
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
## NOTES
|
||||
| | |
|
||||
|-|-|
|
||||
| Author | Praveen Mathamsetty. |
|
||||
| Author email | pmathamsetty@vmware.com |
|
||||
| Version | 1.1 |
|
||||
|
||||
===Tested Against Environment====
|
||||
| | |
|
||||
|-|-|
|
||||
| Horizon View Server Version | 7.0.2, 7.1.0 |
|
||||
| PowerCLI Version | PowerCLI 6.5, PowerCLI 6.5.1 |
|
||||
| PowerShell Version | 5.0 |
|
||||
|
||||
## RELATED LINKS
|
||||
69
Modules/VMware.Hv.Helper/docs/Get-HVGlobalSession.md
Executable file
69
Modules/VMware.Hv.Helper/docs/Get-HVGlobalSession.md
Executable file
@@ -0,0 +1,69 @@
|
||||
---
|
||||
external help file: VMware.HV.Helper-help.xml
|
||||
Module Name: VMware.HV.Helper
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Get-HVGlobalSession
|
||||
|
||||
## SYNOPSIS
|
||||
Provides a list with all Global sessions in a Cloud Pod Architecture
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```
|
||||
Get-HVGlobalSession [[-HvServer] <Object>] [<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
The get-hvglobalsession gets all local session by using view API service object(hvServer) of Connect-HVServer cmdlet.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### EXAMPLE 1
|
||||
```
|
||||
Get-hvglobalsession
|
||||
```
|
||||
|
||||
Gets all global sessions
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -HvServer
|
||||
View API service object of Connect-HVServer cmdlet.
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
## NOTES
|
||||
| | |
|
||||
|-|-|
|
||||
| Author | Wouter Kursten. |
|
||||
| Author email | wouter@retouw.nl |
|
||||
| Version | 1.0 |
|
||||
|
||||
===Tested Against Environment====
|
||||
| | |
|
||||
|-|-|
|
||||
| Horizon View Server Version | 7.0.2, 7.1.0, 7.3.2 |
|
||||
| PowerCLI Version | PowerCLI 6.5, PowerCLI 6.5.1 |
|
||||
| PowerShell Version | 5.0 |
|
||||
|
||||
## RELATED LINKS
|
||||
70
Modules/VMware.Hv.Helper/docs/Get-HVGlobalSettings.md
Executable file
70
Modules/VMware.Hv.Helper/docs/Get-HVGlobalSettings.md
Executable file
@@ -0,0 +1,70 @@
|
||||
---
|
||||
external help file: VMware.HV.Helper-help.xml
|
||||
Module Name: VMware.HV.Helper
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Get-HVGlobalSettings
|
||||
|
||||
## SYNOPSIS
|
||||
Gets a list of Global Settings
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```
|
||||
Get-HVGlobalSettings [[-HvServer] <Object>] [<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
Queries and returns the Global Settings for the pod of the specified HVServer.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### EXAMPLE 1
|
||||
```
|
||||
Get-HVGlobalSettings
|
||||
```
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -HvServer
|
||||
Reference to Horizon View Server to query the virtual machines from.
|
||||
If the value is not passed or null then
|
||||
first element from global:DefaultHVServers would be considered inplace of hvServer
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### Returns list of object type VMware.Hv.GlobalSettingsInfo
|
||||
## NOTES
|
||||
| | |
|
||||
|-|-|
|
||||
| Author | Matt Frey. |
|
||||
| Author email | mfrey@vmware.com |
|
||||
| Version | 1.0 |
|
||||
|
||||
===Tested Against Environment====
|
||||
| | |
|
||||
|-|-|
|
||||
| Horizon View Server Version | 7.1 |
|
||||
| PowerCLI Version | PowerCLI 6.5.1 |
|
||||
| PowerShell Version | 5.0 |
|
||||
|
||||
## RELATED LINKS
|
||||
95
Modules/VMware.Hv.Helper/docs/Get-HVHealth.md
Executable file
95
Modules/VMware.Hv.Helper/docs/Get-HVHealth.md
Executable file
@@ -0,0 +1,95 @@
|
||||
---
|
||||
external help file: VMware.HV.Helper-help.xml
|
||||
Module Name: VMware.HV.Helper
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Get-HVHealth
|
||||
|
||||
## SYNOPSIS
|
||||
Pulls health information from Horizon View
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```
|
||||
Get-HVHealth [[-Servicename] <String>] [[-HvServer] <Object>] [<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
Queries and returns health information from the local Horizon Pod
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### EXAMPLE 1
|
||||
```
|
||||
Get-HVHealth -service connectionserver
|
||||
```
|
||||
|
||||
Returns health for the connectionserver(s)
|
||||
|
||||
### EXAMPLE 2
|
||||
```
|
||||
Get-HVHealth -service ViewComposer
|
||||
```
|
||||
|
||||
Returns health for the View composer server(s)
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -Servicename
|
||||
The name of the service to query the health for.
|
||||
This will default to Connection server health.
|
||||
Available services are ADDomain,CertificateSSOConnector,ConnectionServer,EventDatabase,SAMLAuthenticator,SecurityServer,ViewComposer,VirtualCenter,Pod
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 1
|
||||
Default value: ConnectionServer
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -HvServer
|
||||
Reference to Horizon View Server to query the virtual machines from.
|
||||
If the value is not passed or null then
|
||||
first element from global:DefaultHVServers would be considered in-place of hvServer
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 2
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
## NOTES
|
||||
| | |
|
||||
|-|-|
|
||||
| Author | Wouter Kursten |
|
||||
| Author email | wouter@retouw.nl |
|
||||
| Version | 1.0 |
|
||||
|
||||
===Tested Against Environment====
|
||||
| | |
|
||||
|-|-|
|
||||
| Horizon View Server Version | 7.3.2,7.4 |
|
||||
| PowerCLI Version | PowerCLI 6.5, PowerCLI 6.5.1 |
|
||||
| PowerShell Version | 5.0 |
|
||||
|
||||
## RELATED LINKS
|
||||
89
Modules/VMware.Hv.Helper/docs/Get-HVHomeSite.md
Executable file
89
Modules/VMware.Hv.Helper/docs/Get-HVHomeSite.md
Executable file
@@ -0,0 +1,89 @@
|
||||
---
|
||||
external help file: VMware.HV.Helper-help.xml
|
||||
Module Name: VMware.HV.Helper
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Get-HVHomeSite
|
||||
|
||||
## SYNOPSIS
|
||||
Gets the configured Horizon View Homesites
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```
|
||||
Get-HVHomeSite [[-Group] <String>] [[-HvServer] <Object>] [<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
Gets the configured Horizon View Homesites
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### EXAMPLE 1
|
||||
```
|
||||
Get-HVHomeSite
|
||||
```
|
||||
|
||||
### EXAMPLE 2
|
||||
```
|
||||
Get-HVHomeSite -group group@domain
|
||||
```
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -Group
|
||||
User principal name of a group
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -HvServer
|
||||
Reference to Horizon View Server to query the virtual machines from.
|
||||
If the value is not passed or null then
|
||||
first element from global:DefaultHVServers would be considered in-place of hvServer
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 2
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
## NOTES
|
||||
| | |
|
||||
|-|-|
|
||||
| Author | Wouter Kursten |
|
||||
| Author email | wouter@retouw.nl |
|
||||
| Version | 1.0 |
|
||||
|
||||
===Tested Against Environment====
|
||||
| | |
|
||||
|-|-|
|
||||
| Horizon View Server Version | 7.4 |
|
||||
| PowerCLI Version | PowerCLI 10 |
|
||||
| PowerShell Version | 5.0 |
|
||||
|
||||
## RELATED LINKS
|
||||
120
Modules/VMware.Hv.Helper/docs/Get-HVInternalName.md
Executable file
120
Modules/VMware.Hv.Helper/docs/Get-HVInternalName.md
Executable file
@@ -0,0 +1,120 @@
|
||||
---
|
||||
external help file: VMware.HV.Helper-help.xml
|
||||
Module Name: VMware.HV.Helper
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Get-HVInternalName
|
||||
|
||||
## SYNOPSIS
|
||||
Gets human readable name
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```
|
||||
Get-HVInternalName [-EntityId] <EntityId> [[-VcId] <VirtualCenterId>] [[-BaseImageVmId] <BaseImageVmId>]
|
||||
[[-HvServer] <Object>] [<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
Converts Horizon API Ids to human readable names.
|
||||
Horizon API Ids are base64 encoded, this function
|
||||
will decode and returns internal/human readable names.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### EXAMPLE 1
|
||||
```
|
||||
Get-HVInternalName -EntityId $entityId
|
||||
```
|
||||
|
||||
Decodes Horizon API Id and returns human readable name
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -EntityId
|
||||
Representation of a manageable entity id.
|
||||
|
||||
```yaml
|
||||
Type: EntityId
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -VcId
|
||||
{{ Fill VcId Description }}
|
||||
|
||||
```yaml
|
||||
Type: VirtualCenterId
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 2
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -BaseImageVmId
|
||||
{{ Fill BaseImageVmId Description }}
|
||||
|
||||
```yaml
|
||||
Type: BaseImageVmId
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 3
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -HvServer
|
||||
Reference to Horizon View Server to query the virtual machines from.
|
||||
If the value is not passed or null then
|
||||
first element from global:DefaultHVServers would be considered in-place of hvServer
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 4
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### Returns human readable name
|
||||
## NOTES
|
||||
| | |
|
||||
|-|-|
|
||||
| Author | Praveen Mathamsetty. |
|
||||
| Author email | pmathamsetty@vmware.com |
|
||||
| Version | 1.1 |
|
||||
|
||||
===Tested Against Environment====
|
||||
| | |
|
||||
|-|-|
|
||||
| Horizon View Server Version | 7.0.2, 7.1.0 |
|
||||
| PowerCLI Version | PowerCLI 6.5, PowerCLI 6.5.1 |
|
||||
| PowerShell Version | 5.0 |
|
||||
|
||||
## RELATED LINKS
|
||||
69
Modules/VMware.Hv.Helper/docs/Get-HVLocalSession.md
Executable file
69
Modules/VMware.Hv.Helper/docs/Get-HVLocalSession.md
Executable file
@@ -0,0 +1,69 @@
|
||||
---
|
||||
external help file: VMware.HV.Helper-help.xml
|
||||
Module Name: VMware.HV.Helper
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Get-HVLocalSession
|
||||
|
||||
## SYNOPSIS
|
||||
Provides a list with all sessions on the local pod (works in CPA and non-CPA)
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```
|
||||
Get-HVLocalSession [[-HvServer] <Object>] [<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
The Get-HVLocalSession gets all local session by using view API service object(hvServer) of Connect-HVServer cmdlet.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### EXAMPLE 1
|
||||
```
|
||||
Get-HVLocalSession
|
||||
```
|
||||
|
||||
Get all local sessions
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -HvServer
|
||||
View API service object of Connect-HVServer cmdlet.
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
## NOTES
|
||||
| | |
|
||||
|-|-|
|
||||
Author : Wouter Kursten.
|
||||
Author email : wouter@retouw.nl
|
||||
Version : 1.0
|
||||
|
||||
===Tested Against Environment====
|
||||
| | |
|
||||
|-|-|
|
||||
Horizon View Server Version : 7.0.2, 7.1.0, 7.3.2
|
||||
PowerCLI Version : PowerCLI 6.5, PowerCLI 6.5.1
|
||||
PowerShell Version : 5.0
|
||||
|
||||
## RELATED LINKS
|
||||
180
Modules/VMware.Hv.Helper/docs/Get-HVMachine.md
Executable file
180
Modules/VMware.Hv.Helper/docs/Get-HVMachine.md
Executable file
@@ -0,0 +1,180 @@
|
||||
---
|
||||
external help file: VMware.HV.Helper-help.xml
|
||||
Module Name: VMware.HV.Helper
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Get-HVMachine
|
||||
|
||||
## SYNOPSIS
|
||||
Gets virtual Machine(s) information with given search parameters.
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```
|
||||
Get-HVMachine [[-PoolName] <String>] [[-MachineName] <String>] [[-DnsName] <String>] [[-State] <String>]
|
||||
[[-JsonFilePath] <String>] [[-HvServer] <Object>] [<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
Queries and returns virtual machines information, the machines list would be determined
|
||||
based on queryable fields poolName, dnsName, machineName, state.
|
||||
When more than one
|
||||
fields are used for query the virtual machines which satisfy all fields criteria would be returned.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### EXAMPLE 1
|
||||
```
|
||||
Get-HVMachine -PoolName 'ManualPool'
|
||||
```
|
||||
|
||||
Queries VM(s) with given parameter poolName
|
||||
|
||||
### EXAMPLE 2
|
||||
```
|
||||
Get-HVMachine -MachineName 'PowerCLIVM'
|
||||
```
|
||||
|
||||
Queries VM(s) with given parameter machineName
|
||||
|
||||
### EXAMPLE 3
|
||||
```
|
||||
Get-HVMachine -State CUSTOMIZING
|
||||
```
|
||||
|
||||
Queries VM(s) with given parameter vm state
|
||||
|
||||
### EXAMPLE 4
|
||||
```
|
||||
Get-HVMachine -DnsName 'powercli-*'
|
||||
```
|
||||
|
||||
Queries VM(s) with given parameter dnsName with wildcard character *
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -PoolName
|
||||
Pool name to query for.
|
||||
If the value is null or not provided then filter will not be applied,
|
||||
otherwise the virtual machines which has name same as value will be returned.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -MachineName
|
||||
The name of the Machine to query for.
|
||||
If the value is null or not provided then filter will not be applied,
|
||||
otherwise the virtual machines which has display name same as value will be returned.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 2
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -DnsName
|
||||
DNS name for the Machine to filter with.
|
||||
If the value is null or not provided then filter will not be applied,
|
||||
otherwise the virtual machines which has display name same as value will be returned.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 3
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -State
|
||||
The basic state of the Machine to filter with.
|
||||
If the value is null or not provided then filter will not be applied,
|
||||
otherwise the virtual machines which has display name same as value will be returned.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 4
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -JsonFilePath
|
||||
{{ Fill JsonFilePath Description }}
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 5
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -HvServer
|
||||
Reference to Horizon View Server to query the virtual machines from.
|
||||
If the value is not passed or null then
|
||||
first element from global:DefaultHVServers would be considered in-place of hvServer
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 6
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### Returns list of objects of type MachineInfo
|
||||
## NOTES
|
||||
| | |
|
||||
|-|-|
|
||||
| Author | Praveen Mathamsetty. |
|
||||
| Author email | pmathamsetty@vmware.com |
|
||||
| Version | 1.1 |
|
||||
|
||||
===Tested Against Environment====
|
||||
| | |
|
||||
|-|-|
|
||||
| Horizon View Server Version | 7.0.2, 7.1.0 |
|
||||
| PowerCLI Version | PowerCLI 6.5, PowerCLI 6.5.1 |
|
||||
| PowerShell Version | 5.0 |
|
||||
|
||||
## RELATED LINKS
|
||||
195
Modules/VMware.Hv.Helper/docs/Get-HVMachineSummary.md
Executable file
195
Modules/VMware.Hv.Helper/docs/Get-HVMachineSummary.md
Executable file
@@ -0,0 +1,195 @@
|
||||
---
|
||||
external help file: VMware.HV.Helper-help.xml
|
||||
Module Name: VMware.HV.Helper
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Get-HVMachineSummary
|
||||
|
||||
## SYNOPSIS
|
||||
Gets virtual Machine(s) summary with given search parameters.
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```
|
||||
Get-HVMachineSummary [[-PoolName] <String>] [[-MachineName] <String>] [[-DnsName] <String>] [[-State] <String>]
|
||||
[[-JsonFilePath] <String>] [[-SuppressInfo] <Boolean>] [[-HvServer] <Object>] [<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
Queries and returns virtual machines information, the machines list would be determined
|
||||
based on queryable fields poolName, dnsName, machineName, state.
|
||||
When more than one
|
||||
fields are used for query the virtual machines which satisfy all fields criteria would be returned.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### EXAMPLE 1
|
||||
```
|
||||
Get-HVMachineSummary -PoolName 'ManualPool'
|
||||
```
|
||||
|
||||
Queries VM(s) with given parameter poolName
|
||||
|
||||
### EXAMPLE 2
|
||||
```
|
||||
Get-HVMachineSummary -MachineName 'PowerCLIVM'
|
||||
```
|
||||
|
||||
Queries VM(s) with given parameter machineName
|
||||
|
||||
### EXAMPLE 3
|
||||
```
|
||||
Get-HVMachineSummary -State CUSTOMIZING
|
||||
```
|
||||
|
||||
Queries VM(s) with given parameter vm state
|
||||
|
||||
### EXAMPLE 4
|
||||
```
|
||||
Get-HVMachineSummary -DnsName 'powercli-*'
|
||||
```
|
||||
|
||||
Queries VM(s) with given parameter dnsName with wildcard character *
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -PoolName
|
||||
Pool name to query for.
|
||||
If the value is null or not provided then filter will not be applied,
|
||||
otherwise the virtual machines which has name same as value will be returned.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -MachineName
|
||||
The name of the Machine to query for.
|
||||
If the value is null or not provided then filter will not be applied,
|
||||
otherwise the virtual machines which has display name same as value will be returned.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 2
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -DnsName
|
||||
DNS name for the Machine to filter with.
|
||||
If the value is null or not provided then filter will not be applied,
|
||||
otherwise the virtual machines which has display name same as value will be returned.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 3
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -State
|
||||
The basic state of the Machine to filter with.
|
||||
If the value is null or not provided then filter will not be applied,
|
||||
otherwise the virtual machines which has display name same as value will be returned.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 4
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -JsonFilePath
|
||||
{{ Fill JsonFilePath Description }}
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 5
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -SuppressInfo
|
||||
Suppress text info, when no machine found with given search parameters
|
||||
|
||||
```yaml
|
||||
Type: Boolean
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 6
|
||||
Default value: False
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -HvServer
|
||||
Reference to Horizon View Server to query the virtual machines from.
|
||||
If the value is not passed or null then
|
||||
first element from global:DefaultHVServers would be considered in-place of hvServer
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 7
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### Returns list of objects of type MachineNamesView
|
||||
## NOTES
|
||||
| | |
|
||||
|-|-|
|
||||
| Author | Praveen Mathamsetty. |
|
||||
| Author email | pmathamsetty@vmware.com |
|
||||
| Version | 1.1 |
|
||||
|
||||
===Tested Against Environment====
|
||||
| | |
|
||||
|-|-|
|
||||
| Horizon View Server Version | 7.0.2, 7.1.0 |
|
||||
| PowerCLI Version | PowerCLI 6.5, PowerCLI 6.5.1 |
|
||||
| PowerShell Version | 5.0 |
|
||||
|
||||
## RELATED LINKS
|
||||
71
Modules/VMware.Hv.Helper/docs/Get-HVPodFederation.md
Executable file
71
Modules/VMware.Hv.Helper/docs/Get-HVPodFederation.md
Executable file
@@ -0,0 +1,71 @@
|
||||
---
|
||||
external help file: VMware.HV.Helper-help.xml
|
||||
Module Name: VMware.HV.Helper
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Get-HVPodFederation
|
||||
|
||||
## SYNOPSIS
|
||||
Returns information about a Horizon View Pod Federation (Cloud Pod Architecture)
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```
|
||||
Get-HVPodFederation [[-HvServer] <Object>] [<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
Returns information about a Horizon View Pod Federation (Cloud Pod Architecture)
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### EXAMPLE 1
|
||||
```
|
||||
Get-HVPodFederation
|
||||
```
|
||||
|
||||
Returns information about a Horizon View Pod Federation
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -HvServer
|
||||
Reference to Horizon View Server to query the virtual machines from.
|
||||
If the value is not passed or null then
|
||||
first element from global:DefaultHVServers would be considered in-place of hvServer
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
## NOTES
|
||||
| | |
|
||||
|-|-|
|
||||
| Author | Wouter Kursten |
|
||||
| Author email | wouter@retouw.nl |
|
||||
| Version | 1.0 |
|
||||
|
||||
===Tested Against Environment====
|
||||
| | |
|
||||
|-|-|
|
||||
| Horizon View Server Version | 7.3.2,7.4 |
|
||||
| PowerCLI Version | PowerCLI 6.5, PowerCLI 6.5.1 |
|
||||
| PowerShell Version | 5.0 |
|
||||
|
||||
## RELATED LINKS
|
||||
218
Modules/VMware.Hv.Helper/docs/Get-HVPool.md
Executable file
218
Modules/VMware.Hv.Helper/docs/Get-HVPool.md
Executable file
@@ -0,0 +1,218 @@
|
||||
---
|
||||
external help file: VMware.HV.Helper-help.xml
|
||||
Module Name: VMware.HV.Helper
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Get-HVPool
|
||||
|
||||
## SYNOPSIS
|
||||
Gets pool(s) information with given search parameters.
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```
|
||||
Get-HVPool [[-PoolName] <String>] [[-PoolDisplayName] <String>] [[-PoolType] <String>]
|
||||
[[-UserAssignment] <String>] [[-Enabled] <Boolean>] [[-ProvisioningEnabled] <Boolean>]
|
||||
[[-SuppressInfo] <Boolean>] [[-HvServer] <Object>] [<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
Queries and returns pools information, the pools list would be determined based on
|
||||
queryable fields poolName, poolDisplayName, poolType, userAssignment, enabled,
|
||||
provisioningEnabled.
|
||||
When more than one fields are used for query the pools which
|
||||
satisfy all fields criteria would be returned.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### EXAMPLE 1
|
||||
```
|
||||
Get-HVPool -PoolName 'mypool' -PoolType MANUAL -UserAssignment FLOATING -Enabled $true -ProvisioningEnabled $true
|
||||
```
|
||||
|
||||
Queries and returns pool object(s) based on given parameters poolName, poolType etc.
|
||||
|
||||
### EXAMPLE 2
|
||||
```
|
||||
Get-HVPool -PoolType AUTOMATED -UserAssignment FLOATING
|
||||
```
|
||||
|
||||
Queries and returns pool object(s) based on given parameters poolType and userAssignment
|
||||
|
||||
### EXAMPLE 3
|
||||
```
|
||||
Get-HVPool -PoolName 'myrds' -PoolType RDS -UserAssignment DEDICATED -Enabled $false
|
||||
```
|
||||
|
||||
Queries and returns pool object(s) based on given parameters poolName, PoolType etc.
|
||||
|
||||
### EXAMPLE 4
|
||||
```
|
||||
Get-HVPool -PoolName 'myrds' -PoolType RDS -UserAssignment DEDICATED -Enabled $false -HvServer $mycs
|
||||
```
|
||||
|
||||
Queries and returns pool object(s) based on given parameters poolName and HvServer etc.
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -PoolName
|
||||
Pool name to query for.
|
||||
If the value is null or not provided then filter will not be applied,
|
||||
otherwise the pools which has name same as value will be returned.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -PoolDisplayName
|
||||
Pool display name to query for.
|
||||
If the value is null or not provided then filter will not be applied,
|
||||
otherwise the pools which has display name same as value will be returned.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 2
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -PoolType
|
||||
Pool type to filter with.
|
||||
If the value is null or not provided then filter will not be applied.
|
||||
If the value is MANUAL then only manual pools would be returned.
|
||||
If the value is AUTOMATED then only automated pools would be returned
|
||||
If the value is RDS then only Remote Desktop Service Pool pools would be returned
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 3
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -UserAssignment
|
||||
User Assignment of pool to filter with.
|
||||
If the value is null or not provided then filter will not be applied.
|
||||
If the value is DEDICATED then only dedicated pools would be returned.
|
||||
If the value is FLOATING then only floating pools would be returned
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 4
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Enabled
|
||||
Pool enablement to filter with.
|
||||
If the value is not provided then then filter will not be applied.
|
||||
If the value is true then only pools which are enabled would be returned.
|
||||
If the value is false then only pools which are disabled would be returned.
|
||||
|
||||
```yaml
|
||||
Type: Boolean
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 5
|
||||
Default value: False
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -ProvisioningEnabled
|
||||
{{ Fill ProvisioningEnabled Description }}
|
||||
|
||||
```yaml
|
||||
Type: Boolean
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 6
|
||||
Default value: False
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -SuppressInfo
|
||||
Suppress text info, when no pool found with given search parameters
|
||||
|
||||
```yaml
|
||||
Type: Boolean
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 7
|
||||
Default value: False
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -HvServer
|
||||
Reference to Horizon View Server to query the pools from.
|
||||
If the value is not passed or null then
|
||||
first element from global:DefaultHVServers would be considered in-place of hvServer
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 8
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### Returns list of objects of type DesktopInfo
|
||||
## NOTES
|
||||
| | |
|
||||
|-|-|
|
||||
| Author | Praveen Mathamsetty. |
|
||||
| Author email | pmathamsetty@vmware.com |
|
||||
| Version | 1.1 |
|
||||
|
||||
===Tested Against Environment====
|
||||
| | |
|
||||
|-|-|
|
||||
| Horizon View Server Version | 7.0.2, 7.1.0 |
|
||||
| PowerCLI Version | PowerCLI 6.5, PowerCLI 6.5.1 |
|
||||
| PowerShell Version | 5.0 |
|
||||
|
||||
## RELATED LINKS
|
||||
142
Modules/VMware.Hv.Helper/docs/Get-HVPoolSpec.md
Executable file
142
Modules/VMware.Hv.Helper/docs/Get-HVPoolSpec.md
Executable file
@@ -0,0 +1,142 @@
|
||||
---
|
||||
external help file: VMware.HV.Helper-help.xml
|
||||
Module Name: VMware.HV.Helper
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Get-HVPoolSpec
|
||||
|
||||
## SYNOPSIS
|
||||
Gets desktop specification
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```
|
||||
Get-HVPoolSpec [-DesktopInfo] <DesktopInfo> [[-FilePath] <String>] [[-HvServer] <Object>] [-WhatIf] [-Confirm]
|
||||
[<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
Converts DesktopInfo Object to DesktopSpec.
|
||||
Also Converts view API Ids to human readable names
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### EXAMPLE 1
|
||||
```
|
||||
Get-HVPoolSpec -DesktopInfo $DesktopInfoObj
|
||||
```
|
||||
|
||||
Converts DesktopInfo to DesktopSpec
|
||||
|
||||
### EXAMPLE 2
|
||||
```
|
||||
Get-HVPool -PoolName 'LnkClnJson' | Get-HVPoolSpec -FilePath "C:\temp\LnkClnJson.json"
|
||||
```
|
||||
|
||||
Converts DesktopInfo to DesktopSpec and also dumps json object
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -DesktopInfo
|
||||
An object with detailed description of a desktop instance.
|
||||
|
||||
```yaml
|
||||
Type: DesktopInfo
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -FilePath
|
||||
{{ Fill FilePath Description }}
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 2
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -HvServer
|
||||
Reference to Horizon View Server to query the virtual machines from.
|
||||
If the value is not passed or null then
|
||||
first element from global:DefaultHVServers would be considered in-place of hvServer
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 3
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -WhatIf
|
||||
Shows what would happen if the cmdlet runs.
|
||||
The cmdlet is not run.
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases: wi
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Confirm
|
||||
Prompts you for confirmation before running the cmdlet.
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases: cf
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### Returns desktop specification
|
||||
## NOTES
|
||||
| | |
|
||||
|-|-|
|
||||
| Author | Praveen Mathamsetty. |
|
||||
| Author email | pmathamsetty@vmware.com |
|
||||
| Version | 1.1 |
|
||||
|
||||
===Tested Against Environment====
|
||||
| | |
|
||||
|-|-|
|
||||
| Horizon View Server Version | 7.0.2, 7.1.0 |
|
||||
| PowerCLI Version | PowerCLI 6.5, PowerCLI 6.5.1 |
|
||||
| PowerShell Version | 5.0 |
|
||||
|
||||
## RELATED LINKS
|
||||
218
Modules/VMware.Hv.Helper/docs/Get-HVPoolSummary.md
Executable file
218
Modules/VMware.Hv.Helper/docs/Get-HVPoolSummary.md
Executable file
@@ -0,0 +1,218 @@
|
||||
---
|
||||
external help file: VMware.HV.Helper-help.xml
|
||||
Module Name: VMware.HV.Helper
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Get-HVPoolSummary
|
||||
|
||||
## SYNOPSIS
|
||||
Gets pool summary with given search parameters.
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```
|
||||
Get-HVPoolSummary [[-PoolName] <String>] [[-PoolDisplayName] <String>] [[-PoolType] <String>]
|
||||
[[-UserAssignment] <String>] [[-Enabled] <Boolean>] [[-ProvisioningEnabled] <Boolean>]
|
||||
[[-SuppressInfo] <Boolean>] [[-HvServer] <Object>] [<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
Queries and returns pools information, the pools list would be determined based on
|
||||
queryable fields poolName, poolDisplayName, poolType, userAssignment, enabled,
|
||||
provisioningEnabled.
|
||||
When more than one fields are used for query the pools which
|
||||
satisfy all fields criteria would be returned.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### EXAMPLE 1
|
||||
```
|
||||
Get-HVPoolSummary -PoolName 'mypool' -PoolType MANUAL -UserAssignment FLOATING -Enabled $true -ProvisioningEnabled $true
|
||||
```
|
||||
|
||||
Queries and returns desktopSummaryView based on given parameters poolName, poolType etc.
|
||||
|
||||
### EXAMPLE 2
|
||||
```
|
||||
Get-HVPoolSummary -PoolType AUTOMATED -UserAssignment FLOATING
|
||||
```
|
||||
|
||||
Queries and returns desktopSummaryView based on given parameters poolType, userAssignment.
|
||||
|
||||
### EXAMPLE 3
|
||||
```
|
||||
Get-HVPoolSummary -PoolName 'myrds' -PoolType RDS -UserAssignment DEDICATED -Enabled $false
|
||||
```
|
||||
|
||||
Queries and returns desktopSummaryView based on given parameters poolName, poolType, userAssignment etc.
|
||||
|
||||
### EXAMPLE 4
|
||||
```
|
||||
Get-HVPoolSummary -PoolName 'myrds' -PoolType RDS -UserAssignment DEDICATED -Enabled $false -HvServer $mycs
|
||||
```
|
||||
|
||||
Queries and returns desktopSummaryView based on given parameters poolName, HvServer etc.
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -PoolName
|
||||
Pool name to query for.
|
||||
If the value is null or not provided then filter will not be applied,
|
||||
otherwise the pools which has name same as value will be returned.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -PoolDisplayName
|
||||
Pool display name to query for.
|
||||
If the value is null or not provided then filter will not be applied,
|
||||
otherwise the pools which has display name same as value will be returned.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 2
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -PoolType
|
||||
Pool type to filter with.
|
||||
If the value is null or not provided then filter will not be applied.
|
||||
If the value is MANUAL then only manual pools would be returned.
|
||||
If the value is AUTOMATED then only automated pools would be returned
|
||||
If the value is RDS then only Remote Desktop Service Pool pools would be returned
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 3
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -UserAssignment
|
||||
User Assignment of pool to filter with.
|
||||
If the value is null or not provided then filter will not be applied.
|
||||
If the value is DEDICATED then only dedicated pools would be returned.
|
||||
If the value is FLOATING then only floating pools would be returned
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 4
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Enabled
|
||||
Pool enablement to filter with.
|
||||
If the value is not provided then then filter will not be applied.
|
||||
If the value is true then only pools which are enabled would be returned.
|
||||
If the value is false then only pools which are disabled would be returned.
|
||||
|
||||
```yaml
|
||||
Type: Boolean
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 5
|
||||
Default value: False
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -ProvisioningEnabled
|
||||
{{ Fill ProvisioningEnabled Description }}
|
||||
|
||||
```yaml
|
||||
Type: Boolean
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 6
|
||||
Default value: False
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -SuppressInfo
|
||||
Suppress text info, when no pool found with given search parameters
|
||||
|
||||
```yaml
|
||||
Type: Boolean
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 7
|
||||
Default value: False
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -HvServer
|
||||
Reference to Horizon View Server to query the pools from.
|
||||
If the value is not passed or null then
|
||||
first element from global:DefaultHVServers would be considered in-place of hvServer
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 8
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### Returns list of DesktopSummaryView
|
||||
## NOTES
|
||||
| | |
|
||||
|-|-|
|
||||
| Author | Praveen Mathamsetty. |
|
||||
| Author email | pmathamsetty@vmware.com |
|
||||
| Version | 1.1 |
|
||||
|
||||
===Tested Against Environment====
|
||||
| | |
|
||||
|-|-|
|
||||
| Horizon View Server Version | 7.0.2, 7.1.0 |
|
||||
| PowerCLI Version | PowerCLI 6.5, PowerCLI 6.5.1 |
|
||||
| PowerShell Version | 5.0 |
|
||||
|
||||
## RELATED LINKS
|
||||
85
Modules/VMware.Hv.Helper/docs/Get-HVPreInstalledApplication.md
Executable file
85
Modules/VMware.Hv.Helper/docs/Get-HVPreInstalledApplication.md
Executable file
@@ -0,0 +1,85 @@
|
||||
---
|
||||
external help file: VMware.HV.Helper-help.xml
|
||||
Module Name: VMware.HV.Helper
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Get-HVPreInstalledApplication
|
||||
|
||||
## SYNOPSIS
|
||||
Gets the list of Pre-installed Applications from the RDS Server(s).
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```
|
||||
Get-HVPreInstalledApplication [-FarmName] <String> [[-HvServer] <Object>] [<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
Gets the list of Pre-installed Applications from the RDS Server(s).
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### EXAMPLE 1
|
||||
```
|
||||
Get-HVPreInstalledApplication -FarmName 'Farm1' -HvServer $HvServer
|
||||
```
|
||||
|
||||
Gets the list of Applications present in 'Farm1', if exists.
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -FarmName
|
||||
Name of the Farm on which to discover installed applications.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -HvServer
|
||||
View API service object of Connect-HVServer cmdlet.
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 2
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### Gets the list of Applications from the specified Farm if exists.
|
||||
## NOTES
|
||||
| | |
|
||||
|-|-|
|
||||
| Author | Samiullasha S |
|
||||
| Author email | ssami@vmware.com |
|
||||
| Version | 1.0 |
|
||||
|
||||
===Tested Against Environment====
|
||||
| | |
|
||||
|-|-|
|
||||
| Horizon View Server Version | 7.8.0 |
|
||||
| PowerCLI Version | PowerCLI 11.1 |
|
||||
| PowerShell Version | 5.0 |
|
||||
|
||||
## RELATED LINKS
|
||||
308
Modules/VMware.Hv.Helper/docs/Get-HVQueryFilter.md
Executable file
308
Modules/VMware.Hv.Helper/docs/Get-HVQueryFilter.md
Executable file
@@ -0,0 +1,308 @@
|
||||
---
|
||||
external help file: VMware.HV.Helper-help.xml
|
||||
Module Name: VMware.HV.Helper
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Get-HVQueryFilter
|
||||
|
||||
## SYNOPSIS
|
||||
Creates a VMware.Hv.QueryFilter based on input provided.
|
||||
|
||||
## SYNTAX
|
||||
|
||||
### ne
|
||||
```
|
||||
Get-HVQueryFilter [-MemberName] <String> [-Ne] [-MemberValue] <Object> [<CommonParameters>]
|
||||
```
|
||||
|
||||
### startswith
|
||||
```
|
||||
Get-HVQueryFilter [-MemberName] <String> [-Startswith] [-MemberValue] <Object> [<CommonParameters>]
|
||||
```
|
||||
|
||||
### contains
|
||||
```
|
||||
Get-HVQueryFilter [-MemberName] <String> [-Contains] [-MemberValue] <Object> [<CommonParameters>]
|
||||
```
|
||||
|
||||
### eq
|
||||
```
|
||||
Get-HVQueryFilter [-MemberName] <String> [-Eq] [-MemberValue] <Object> [<CommonParameters>]
|
||||
```
|
||||
|
||||
### not
|
||||
```
|
||||
Get-HVQueryFilter [-Not] [-Filter] <QueryFilter> [<CommonParameters>]
|
||||
```
|
||||
|
||||
### and
|
||||
```
|
||||
Get-HVQueryFilter [-And] [-Filters] <QueryFilter[]> [<CommonParameters>]
|
||||
```
|
||||
|
||||
### or
|
||||
```
|
||||
Get-HVQueryFilter [-Or] [-Filters] <QueryFilter[]> [<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
This is a factory method to create a VMware.Hv.QueryFilter.
|
||||
The type of the QueryFilter would be determined based on switch used.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### EXAMPLE 1
|
||||
```
|
||||
Get-HVQueryFilter data.name -Eq vmware
|
||||
```
|
||||
|
||||
Creates queryFilterEquals with given parameters memberName(position 0) and memberValue(position 2)
|
||||
|
||||
### EXAMPLE 2
|
||||
```
|
||||
Get-HVQueryFilter -MemberName data.name -Eq -MemberValue vmware
|
||||
```
|
||||
|
||||
Creates queryFilterEquals with given parameters memberName and memberValue
|
||||
|
||||
### EXAMPLE 3
|
||||
```
|
||||
Get-HVQueryFilter data.name -Ne vmware
|
||||
```
|
||||
|
||||
Creates queryFilterNotEquals filter with given parameters memberName and memberValue
|
||||
|
||||
### EXAMPLE 4
|
||||
```
|
||||
Get-HVQueryFilter data.name -Contains vmware
|
||||
```
|
||||
|
||||
Creates queryFilterContains with given parameters memberName and memberValue
|
||||
|
||||
### EXAMPLE 5
|
||||
```
|
||||
Get-HVQueryFilter data.name -Startswith vmware
|
||||
```
|
||||
|
||||
Creates queryFilterStartsWith with given parameters memberName and memberValue
|
||||
|
||||
### EXAMPLE 6
|
||||
```
|
||||
$filter = Get-HVQueryFilter data.name -Startswith vmware
|
||||
```
|
||||
|
||||
Get-HVQueryFilter -Not $filter
|
||||
Creates queryFilterNot with given parameter filter
|
||||
|
||||
### EXAMPLE 7
|
||||
```
|
||||
$filter1 = Get-HVQueryFilter data.name -Startswith vmware
|
||||
```
|
||||
|
||||
$filter2 = Get-HVQueryFilter data.name -Contains pool
|
||||
Get-HVQueryFilter -And @($filter1, $filter2)
|
||||
|
||||
Creates queryFilterAnd with given parameter filters array
|
||||
|
||||
### EXAMPLE 8
|
||||
```
|
||||
$filter1 = Get-HVQueryFilter data.name -Startswith vmware
|
||||
```
|
||||
|
||||
$filter2 = Get-HVQueryFilter data.name -Contains pool
|
||||
Get-HVQueryFilter -Or @($filter1, $filter2)
|
||||
Creates queryFilterOr with given parameter filters array
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -MemberName
|
||||
Property path separated by .
|
||||
(dot) from the root of queryable data object which is being queried for
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: ne, startswith, contains, eq
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Eq
|
||||
Switch to create QueryFilterEquals filter
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: eq
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 2
|
||||
Default value: False
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Contains
|
||||
Switch to create QueryFilterContains filter
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: contains
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 2
|
||||
Default value: False
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Startswith
|
||||
Switch to create QueryFilterStartsWith filter
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: startswith
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 2
|
||||
Default value: False
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Ne
|
||||
Switch to create QueryFilterNotEquals filter
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: ne
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 2
|
||||
Default value: False
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -MemberValue
|
||||
Value of property (memberName) which is used for filtering
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: ne, startswith, contains, eq
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 3
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Not
|
||||
Switch to create QueryFilterNot filter, used for negating existing filter
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: not
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 1
|
||||
Default value: False
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Filter
|
||||
Filter to used in QueryFilterNot to negate the result
|
||||
|
||||
```yaml
|
||||
Type: QueryFilter
|
||||
Parameter Sets: not
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 2
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -And
|
||||
Switch to create QueryFilterAnd filter, used for joing two or more filters
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: and
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 1
|
||||
Default value: False
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Or
|
||||
Switch to create QueryFilterOr filter, used for joing two or more filters
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: or
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 1
|
||||
Default value: False
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Filters
|
||||
List of filters to join using QueryFilterAnd or QueryFilterOr
|
||||
|
||||
```yaml
|
||||
Type: QueryFilter[]
|
||||
Parameter Sets: and, or
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 2
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### Returns the QueryFilter object
|
||||
## NOTES
|
||||
| | |
|
||||
|-|-|
|
||||
| Author | Kummara Ramamohan. |
|
||||
| Author email | kramamohan@vmware.com |
|
||||
| Version | 1.1 |
|
||||
|
||||
===Tested Against Environment====
|
||||
| | |
|
||||
|-|-|
|
||||
| Horizon View Server Version | 7.0.2, 7.1.0 |
|
||||
| PowerCLI Version | PowerCLI 6.5, PowerCLI 6.5.1 |
|
||||
| PowerShell Version | 5.0 |
|
||||
|
||||
## RELATED LINKS
|
||||
181
Modules/VMware.Hv.Helper/docs/Get-HVQueryResult.md
Executable file
181
Modules/VMware.Hv.Helper/docs/Get-HVQueryResult.md
Executable file
@@ -0,0 +1,181 @@
|
||||
---
|
||||
external help file: VMware.HV.Helper-help.xml
|
||||
Module Name: VMware.HV.Helper
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Get-HVQueryResult
|
||||
|
||||
## SYNOPSIS
|
||||
Returns the query results from ViewApi Query Service
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```
|
||||
Get-HVQueryResult [-EntityType] <String> [[-Filter] <QueryFilter>] [[-SortBy] <String>]
|
||||
[[-SortDescending] <Boolean>] [[-Limit] <Int16>] [[-HvServer] <Object>] [<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
Get-HVQueryResult is a API to query the results using ViewApi.
|
||||
The filtering of the returned
|
||||
list would be done based on input parameters filter, sortDescending, sortyBy, limit
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### EXAMPLE 1
|
||||
```
|
||||
Get-HVQueryResult DesktopSummaryView
|
||||
```
|
||||
|
||||
Returns query results of entityType DesktopSummaryView(position 0)
|
||||
|
||||
### EXAMPLE 2
|
||||
```
|
||||
Get-HVQueryResult DesktopSummaryView (Get-HVQueryFilter data.name -Eq vmware)
|
||||
```
|
||||
|
||||
Returns query results of entityType DesktopSummaryView(position 0) with given filter(position 1)
|
||||
|
||||
### EXAMPLE 3
|
||||
```
|
||||
Get-HVQueryResult -EntityType DesktopSummaryView -Filter (Get-HVQueryFilter desktopSummaryData.name -Eq vmware)
|
||||
```
|
||||
|
||||
Returns query results of entityType DesktopSummaryView with given filter
|
||||
|
||||
### EXAMPLE 4
|
||||
```
|
||||
$myFilter = Get-HVQueryFilter data.name -Contains vmware
|
||||
```
|
||||
|
||||
Get-HVQueryResult -EntityType DesktopSummaryView -Filter $myFilter -SortBy desktopSummaryData.displayName -SortDescending $false
|
||||
Returns query results of entityType DesktopSummaryView with given filter and also sorted based on dispalyName
|
||||
|
||||
### EXAMPLE 5
|
||||
```
|
||||
Get-HVQueryResult DesktopSummaryView -Limit 10
|
||||
```
|
||||
|
||||
Returns query results of entityType DesktopSummaryView, maximum count equal to limit
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -EntityType
|
||||
ViewApi Queryable entity type which is being queried for.The return list would be containing objects of entityType
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Filter
|
||||
Filter to used for filtering the results, See Get-HVQueryFilter for more information
|
||||
|
||||
```yaml
|
||||
Type: QueryFilter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 2
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -SortBy
|
||||
Data field path used for sorting the results
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 3
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -SortDescending
|
||||
If the value is set to true (default) then the results will be sorted in descending order
|
||||
If the value is set to false then the results will be sorted in ascending order
|
||||
|
||||
```yaml
|
||||
Type: Boolean
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 4
|
||||
Default value: True
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Limit
|
||||
Max number of objects to retrieve.
|
||||
Default would be 0 which means retieve all the results
|
||||
|
||||
```yaml
|
||||
Type: Int16
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 5
|
||||
Default value: 0
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -HvServer
|
||||
Reference to Horizon View Server to query the data from.
|
||||
If the value is not passed or null then
|
||||
first element from global:DefaultHVServers would be considered in-place of hvServer
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 6
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### Returns the list of objects of entityType
|
||||
## NOTES
|
||||
| | |
|
||||
|-|-|
|
||||
| Author | Kummara Ramamohan. |
|
||||
| Author email | kramamohan@vmware.com |
|
||||
| Version | 1.1 |
|
||||
|
||||
===Tested Against Environment====
|
||||
| | |
|
||||
|-|-|
|
||||
| Horizon View Server Version | 7.0.2, 7.1.0,7.4 |
|
||||
| PowerCLI Version | PowerCLI 6.5, PowerCLI 6.5.1, PowerCLI 10.1.1 |
|
||||
| PowerShell Version | 5.0 |
|
||||
|
||||
## RELATED LINKS
|
||||
70
Modules/VMware.Hv.Helper/docs/Get-HVResourceStructure.md
Executable file
70
Modules/VMware.Hv.Helper/docs/Get-HVResourceStructure.md
Executable file
@@ -0,0 +1,70 @@
|
||||
---
|
||||
external help file: VMware.HV.Helper-help.xml
|
||||
Module Name: VMware.HV.Helper
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Get-HVResourceStructure
|
||||
|
||||
## SYNOPSIS
|
||||
Output the structure of the resource pools available to a HV.
|
||||
Primarily this is for debugging
|
||||
|
||||
PS\> Get-HVResourceStructure
|
||||
vCenter vc.domain.local
|
||||
Container DC path /DC/host
|
||||
HostOrCluster Servers path /DC/host/Servers
|
||||
HostOrCluster VDI path /DC/host/VDI
|
||||
ResourcePool Servers path /DC/host/Servers/Resources
|
||||
ResourcePool VDI path /DC/host/VDI/Resources
|
||||
ResourcePool RP1 path /DC/host/VDI/Resources/RP1
|
||||
ResourcePool RP2 path /DC/host/VDI/Resources/RP1/RP2
|
||||
|
||||
| Author | Mark Elvers \<mark.elvers@tunbury.org\> |
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```
|
||||
Get-HVResourceStructure [[-HvServer] <Object>] [<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
{{ Fill in the Description }}
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### Example 1
|
||||
```powershell
|
||||
PS C:\> {{ Add example code here }}
|
||||
```
|
||||
|
||||
{{ Add example description here }}
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -HvServer
|
||||
{{ Fill HvServer Description }}
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
## NOTES
|
||||
|
||||
## RELATED LINKS
|
||||
71
Modules/VMware.Hv.Helper/docs/Get-HVSite.md
Executable file
71
Modules/VMware.Hv.Helper/docs/Get-HVSite.md
Executable file
@@ -0,0 +1,71 @@
|
||||
---
|
||||
external help file: VMware.HV.Helper-help.xml
|
||||
Module Name: VMware.HV.Helper
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Get-HVSite
|
||||
|
||||
## SYNOPSIS
|
||||
Returns information about the sites within a Horizon View Pod Federation (Cloud Pod Architecture)
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```
|
||||
Get-HVSite [[-HvServer] <Object>] [<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
Returns information about the sites within a Horizon View Pod Federation (Cloud Pod Architecture)
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### EXAMPLE 1
|
||||
```
|
||||
get-hvsite
|
||||
```
|
||||
|
||||
Returns information about the sites within a Horizon View Pod Federation.
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -HvServer
|
||||
Reference to Horizon View Server to query the virtual machines from.
|
||||
If the value is not passed or null then
|
||||
first element from global:DefaultHVServers would be considered in-place of hvServer
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
## NOTES
|
||||
| | |
|
||||
|-|-|
|
||||
| Author | Wouter Kursten |
|
||||
| Author email | wouter@retouw.nl |
|
||||
| Version | 1.0 |
|
||||
|
||||
===Tested Against Environment====
|
||||
| | |
|
||||
|-|-|
|
||||
| Horizon View Server Version | 7.3.2,7.4 |
|
||||
| PowerCLI Version | PowerCLI 6.5, PowerCLI 6.5.1 |
|
||||
| PowerShell Version | 5.0 |
|
||||
|
||||
## RELATED LINKS
|
||||
69
Modules/VMware.Hv.Helper/docs/Get-HVlicense.md
Executable file
69
Modules/VMware.Hv.Helper/docs/Get-HVlicense.md
Executable file
@@ -0,0 +1,69 @@
|
||||
---
|
||||
external help file: VMware.HV.Helper-help.xml
|
||||
Module Name: VMware.HV.Helper
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Get-HVlicense
|
||||
|
||||
## SYNOPSIS
|
||||
Gets the license for Horizon View
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```
|
||||
Get-HVlicense [[-HvServer] <Object>] [<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
Gets the license for Horizon View
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### EXAMPLE 1
|
||||
```
|
||||
get-hvlicense
|
||||
```
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -HvServer
|
||||
Reference to Horizon View Server to query the virtual machines from.
|
||||
If the value is not passed or null then
|
||||
first element from global:DefaultHVServers would be considered in-place of hvServer
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
## NOTES
|
||||
| | |
|
||||
|-|-|
|
||||
| Author | Wouter Kursten |
|
||||
| Author email | wouter@retouw.nl |
|
||||
| Version | 1.0 |
|
||||
|
||||
===Tested Against Environment====
|
||||
| | |
|
||||
|-|-|
|
||||
| Horizon View Server Version | 7.4,7.5 |
|
||||
| PowerCLI Version | PowerCLI 10 |
|
||||
| PowerShell Version | 5.0 |
|
||||
|
||||
## RELATED LINKS
|
||||
90
Modules/VMware.Hv.Helper/docs/Get-HVvCenterServer.md
Executable file
90
Modules/VMware.Hv.Helper/docs/Get-HVvCenterServer.md
Executable file
@@ -0,0 +1,90 @@
|
||||
---
|
||||
external help file: VMware.HV.Helper-help.xml
|
||||
Module Name: VMware.HV.Helper
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Get-HVvCenterServer
|
||||
|
||||
## SYNOPSIS
|
||||
Gets a list of all configured vCenter Servers
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```
|
||||
Get-HVvCenterServer [[-HvServer] <Object>] [[-Name] <String>] [<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
Queries and returns the vCenter Servers configured for the pod of the specified HVServer.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### EXAMPLE 1
|
||||
```
|
||||
Get-HVvCenterServer
|
||||
```
|
||||
|
||||
### EXAMPLE 2
|
||||
```
|
||||
Get-HVvCenterServer -Name 'vCenter1'
|
||||
```
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -HvServer
|
||||
Reference to Horizon View Server to query the virtual machines from.
|
||||
If the value is not passed or null then
|
||||
first element from global:DefaultHVServers would be considered inplace of hvServer
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Name
|
||||
A string value to query a vCenter Server by Name, if it is known.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 2
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### Returns array of object type VMware.Hv.VirtualCenterInfo
|
||||
## NOTES
|
||||
| | |
|
||||
|-|-|
|
||||
| Author | Matt Frey. |
|
||||
| Author email | mfrey@vmware.com |
|
||||
| Version | 1.0 |
|
||||
|
||||
===Tested Against Environment====
|
||||
| | |
|
||||
|-|-|
|
||||
| Horizon View Server Version | 7.7 |
|
||||
| PowerCLI Version | PowerCLI 11.2.0 |
|
||||
| PowerShell Version | 5.1 |
|
||||
|
||||
## RELATED LINKS
|
||||
97
Modules/VMware.Hv.Helper/docs/Get-HVvCenterServerHealth.md
Executable file
97
Modules/VMware.Hv.Helper/docs/Get-HVvCenterServerHealth.md
Executable file
@@ -0,0 +1,97 @@
|
||||
---
|
||||
external help file: VMware.HV.Helper-help.xml
|
||||
Module Name: VMware.HV.Helper
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Get-HVvCenterServerHealth
|
||||
|
||||
## SYNOPSIS
|
||||
Gets a the health info for a given vCenter Server.
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```
|
||||
Get-HVvCenterServerHealth [[-HvServer] <Object>] [[-VirtualCenter] <Object>] [<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
Queries and returns the VirtualCenterHealthInfo specified HVServer.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### EXAMPLE 1
|
||||
```
|
||||
Get-HVvCenterServerHealth -VirtualCenter 'vCenter1'
|
||||
```
|
||||
|
||||
### EXAMPLE 2
|
||||
```
|
||||
Get-HVvCenterServerHealth -VirtualCenter $vCenter1
|
||||
```
|
||||
|
||||
### EXAMPLE 3
|
||||
```
|
||||
Get-HVvCenterServerHealth
|
||||
```
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -HvServer
|
||||
Reference to Horizon View Server to query the virtual machines from.
|
||||
If the value is not passed or null then
|
||||
first element from global:DefaultHVServers would be considered inplace of hvServer
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -VirtualCenter
|
||||
A parameter to specify which vCenter Server to check health for.
|
||||
If not specified, this function will return the
|
||||
health info for all vCenter Servers.
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 2
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### Returns array of object type VMware.Hv.VirtualCenterInfo
|
||||
## NOTES
|
||||
| | |
|
||||
|-|-|
|
||||
| Author | Matt Frey. |
|
||||
| Author email | mfrey@vmware.com |
|
||||
| Version | 1.0 |
|
||||
|
||||
===Tested Against Environment====
|
||||
| | |
|
||||
|-|-|
|
||||
| Horizon View Server Version | 7.7 |
|
||||
| PowerCLI Version | PowerCLI 11.2.0 |
|
||||
| PowerShell Version | 5.1 |
|
||||
|
||||
## RELATED LINKS
|
||||
221
Modules/VMware.Hv.Helper/docs/New-HVEntitlement.md
Executable file
221
Modules/VMware.Hv.Helper/docs/New-HVEntitlement.md
Executable file
@@ -0,0 +1,221 @@
|
||||
---
|
||||
external help file: VMware.HV.Helper-help.xml
|
||||
Module Name: VMware.HV.Helper
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# New-HVEntitlement
|
||||
|
||||
## SYNOPSIS
|
||||
Associates a user/group with a resource
|
||||
|
||||
## SYNTAX
|
||||
|
||||
### Default
|
||||
```
|
||||
New-HVEntitlement -User <String> -ResourceName <String> [-ResourceType <String>] [-Type <String>]
|
||||
[-HvServer <Object>] [-WhatIf] [-Confirm] [<CommonParameters>]
|
||||
```
|
||||
|
||||
### PipeLine
|
||||
```
|
||||
New-HVEntitlement -User <String> -Resource <Object> [-ResourceType <String>] [-Type <String>]
|
||||
[-HvServer <Object>] [-WhatIf] [-Confirm] [<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
This represents a simple association between a single user/group and a resource that they can be assigned.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### EXAMPLE 1
|
||||
```
|
||||
New-HVEntitlement -User 'administrator@adviewdev.eng.vmware.com' -ResourceName 'InsClnPol' -Confirm:$false
|
||||
```
|
||||
|
||||
Associate a user/group with a pool
|
||||
|
||||
### EXAMPLE 2
|
||||
```
|
||||
New-HVEntitlement -User 'adviewdev\administrator' -ResourceName 'Calculator' -ResourceType Application
|
||||
```
|
||||
|
||||
Associate a user/group with a application
|
||||
|
||||
### EXAMPLE 3
|
||||
```
|
||||
New-HVEntitlement -User 'adviewdev.eng.vmware.com\administrator' -ResourceName 'UrlSetting1' -ResourceType URLRedirection
|
||||
```
|
||||
|
||||
Associate a user/group with a URLRedirection settings
|
||||
|
||||
### EXAMPLE 4
|
||||
```
|
||||
New-HVEntitlement -User 'adviewdev.eng.vmware.com\administrator' -ResourceName 'GE1' -ResourceType GlobalEntitlement
|
||||
```
|
||||
|
||||
Associate a user/group with a desktop entitlement
|
||||
|
||||
### EXAMPLE 5
|
||||
```
|
||||
New-HVEntitlement -User 'adviewdev\administrator' -ResourceName 'GEAPP1' -ResourceType GlobalApplicationEntitlement
|
||||
```
|
||||
|
||||
Associate a user/group with a application entitlement
|
||||
|
||||
### EXAMPLE 6
|
||||
```
|
||||
$pools = Get-HVPool; $pools | New-HVEntitlement -User 'adviewdev\administrator' -Confirm:$false
|
||||
```
|
||||
|
||||
Associate a user/group with list of pools
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -User
|
||||
User principal name of user or group
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -ResourceName
|
||||
The resource(Application, Desktop etc.) name.
|
||||
Supports only wildcard character '*' when resource type is desktop.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: Default
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Resource
|
||||
Object(s) of the resource(Application, Desktop etc.) to entitle
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: PipeLine
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -ResourceType
|
||||
Type of Resource(Application, Desktop etc)
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: Desktop
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Type
|
||||
Whether or not this is a group or a user.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: User
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -HvServer
|
||||
Reference to Horizon View Server.
|
||||
If the value is not passed or null then
|
||||
first element from global:DefaultHVServers would be considered in-place of hvServer
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -WhatIf
|
||||
Shows what would happen if the cmdlet runs.
|
||||
The cmdlet is not run.
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases: wi
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Confirm
|
||||
Prompts you for confirmation before running the cmdlet.
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases: cf
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
## NOTES
|
||||
| | |
|
||||
|-|-|
|
||||
| Author | Praveen Mathamsetty. |
|
||||
| Author email | pmathamsetty@vmware.com |
|
||||
| Version | 1.1 |
|
||||
|
||||
===Tested Against Environment====
|
||||
| | |
|
||||
|-|-|
|
||||
| Horizon View Server Version | 7.0.2, 7.1.0 |
|
||||
| PowerCLI Version | PowerCLI 6.5, PowerCLI 6.5.1 |
|
||||
| PowerShell Version | 5.0 |
|
||||
|
||||
## RELATED LINKS
|
||||
1133
Modules/VMware.Hv.Helper/docs/New-HVFarm.md
Executable file
1133
Modules/VMware.Hv.Helper/docs/New-HVFarm.md
Executable file
File diff suppressed because it is too large
Load Diff
329
Modules/VMware.Hv.Helper/docs/New-HVGlobalEntitlement.md
Executable file
329
Modules/VMware.Hv.Helper/docs/New-HVGlobalEntitlement.md
Executable file
@@ -0,0 +1,329 @@
|
||||
---
|
||||
external help file: VMware.HV.Helper-help.xml
|
||||
Module Name: VMware.HV.Helper
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# New-HVGlobalEntitlement
|
||||
|
||||
## SYNOPSIS
|
||||
Creates a Global Entitlement.
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```
|
||||
New-HVGlobalEntitlement [-DisplayName] <String> [-Type] <String> [[-Description] <String>] [[-Scope] <String>]
|
||||
[[-Dedicated] <Boolean>] [[-FromHome] <Boolean>] [[-RequireHomeSite] <Boolean>]
|
||||
[[-MultipleSessionAutoClean] <Boolean>] [[-Enabled] <Boolean>] [[-SupportedDisplayProtocols] <String[]>]
|
||||
[[-DefaultDisplayProtocol] <String>] [[-AllowUsersToChooseProtocol] <Boolean>]
|
||||
[[-AllowUsersToResetMachines] <Boolean>] [[-EnableHTMLAccess] <Boolean>] [[-HvServer] <Object>] [-WhatIf]
|
||||
[-Confirm] [<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
Global entitlements are used to route users to their resources across multiple pods.
|
||||
These are persisted in a global ldap instance that is replicated across all pods in a linked mode view set.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### EXAMPLE 1
|
||||
```
|
||||
New-HVGlobalEntitlement -DisplayName 'GE_APP' -Type APPLICATION_ENTITLEMENT
|
||||
```
|
||||
|
||||
Creates new global application entitlement
|
||||
|
||||
### EXAMPLE 2
|
||||
```
|
||||
New-HVGlobalEntitlement -DisplayName 'GE_DESKTOP' -Type DESKTOP_ENTITLEMENT
|
||||
```
|
||||
|
||||
Creates new global desktop entitlement
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -DisplayName
|
||||
Display Name of Global Entitlement.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Type
|
||||
Specify whether to create desktop/app global entitlement
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 2
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Description
|
||||
Description of Global Entitlement.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 3
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Scope
|
||||
Scope for this global entitlement.
|
||||
Visibility and Placement policies are defined by this value.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 4
|
||||
Default value: ANY
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Dedicated
|
||||
Specifies whether dedicated/floating resources associated with this global entitlement.
|
||||
|
||||
```yaml
|
||||
Type: Boolean
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 5
|
||||
Default value: False
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -FromHome
|
||||
This value defines the starting location for resource placement and search.
|
||||
When true, a pod in the user's home site is used to start the search.
|
||||
When false, the current site is used.
|
||||
|
||||
```yaml
|
||||
Type: Boolean
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 6
|
||||
Default value: False
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -RequireHomeSite
|
||||
This value determines whether we fail if a home site isn't defined for this global entitlement.
|
||||
|
||||
```yaml
|
||||
Type: Boolean
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 7
|
||||
Default value: False
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -MultipleSessionAutoClean
|
||||
This value is used to determine if automatic session clean up is enabled.
|
||||
This cannot be enabled when this Global Entitlement is associated with a Desktop that has dedicated user assignment.
|
||||
|
||||
```yaml
|
||||
Type: Boolean
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 8
|
||||
Default value: False
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Enabled
|
||||
If this Global Entitlement is enabled.
|
||||
|
||||
```yaml
|
||||
Type: Boolean
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 9
|
||||
Default value: False
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -SupportedDisplayProtocols
|
||||
The set of supported display protocols for the global entitlement.
|
||||
|
||||
```yaml
|
||||
Type: String[]
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 10
|
||||
Default value: @("PCOIP","BLAST")
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -DefaultDisplayProtocol
|
||||
The default display protocol for the global entitlement.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 11
|
||||
Default value: PCOIP
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -AllowUsersToChooseProtocol
|
||||
Whether the users can choose the protocol used.
|
||||
|
||||
```yaml
|
||||
Type: Boolean
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 12
|
||||
Default value: True
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -AllowUsersToResetMachines
|
||||
Whether users are allowed to reset/restart their machines.
|
||||
|
||||
```yaml
|
||||
Type: Boolean
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 13
|
||||
Default value: False
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -EnableHTMLAccess
|
||||
If set to true, the desktops that are associated with this GlobalEntitlement must also have HTML Access enabled.
|
||||
|
||||
```yaml
|
||||
Type: Boolean
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 14
|
||||
Default value: False
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -HvServer
|
||||
Reference to Horizon View Server.
|
||||
If the value is not passed or null then
|
||||
first element from global:DefaultHVServers would be considered in-place of hvServer
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 15
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -WhatIf
|
||||
Shows what would happen if the cmdlet runs.
|
||||
The cmdlet is not run.
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases: wi
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Confirm
|
||||
Prompts you for confirmation before running the cmdlet.
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases: cf
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
## NOTES
|
||||
| | |
|
||||
|-|-|
|
||||
| Author | Praveen Mathamsetty. |
|
||||
| Author email | pmathamsetty@vmware.com |
|
||||
| Version | 1.1 |
|
||||
|
||||
===Tested Against Environment====
|
||||
| | |
|
||||
|-|-|
|
||||
| Horizon View Server Version | 7.0.2, 7.1.0 |
|
||||
| PowerCLI Version | PowerCLI 6.5, PowerCLI 6.5.1 |
|
||||
| PowerShell Version | 5.0 |
|
||||
|
||||
## RELATED LINKS
|
||||
178
Modules/VMware.Hv.Helper/docs/New-HVHomeSite.md
Executable file
178
Modules/VMware.Hv.Helper/docs/New-HVHomeSite.md
Executable file
@@ -0,0 +1,178 @@
|
||||
---
|
||||
external help file: VMware.HV.Helper-help.xml
|
||||
Module Name: VMware.HV.Helper
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# New-HVHomeSite
|
||||
|
||||
## SYNOPSIS
|
||||
Defines a homesite within a Horizon View Cloud Pod architecture
|
||||
|
||||
## SYNTAX
|
||||
|
||||
### Default (Default)
|
||||
```
|
||||
New-HVHomeSite -Group <String> -Site <String> [-HvServer <Object>] [<CommonParameters>]
|
||||
```
|
||||
|
||||
### globalApplicationEntitlement
|
||||
```
|
||||
New-HVHomeSite [-Group <String>] [-Site <String>] [-globalApplicationEntitlement <String>] [-HvServer <Object>]
|
||||
[<CommonParameters>]
|
||||
```
|
||||
|
||||
### globalEntitlement
|
||||
```
|
||||
New-HVHomeSite [-Group <String>] [-Site <String>] [-globalEntitlement <String>] [-HvServer <Object>]
|
||||
[<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
Creates a new homesite within a Cloud Pod Archtitecture.
|
||||
By default it will be applied to everything
|
||||
but the choice can be made to only apply for a single global entitlement or singel global application entitlement
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### EXAMPLE 1
|
||||
```
|
||||
New-HVHomeSite -group group@domain -site SITE
|
||||
```
|
||||
|
||||
### EXAMPLE 2
|
||||
```
|
||||
New-HVHomeSite -group group@domain -site SITE -globalapplicationentitlement ge-ap01
|
||||
```
|
||||
|
||||
### EXAMPLE 3
|
||||
```
|
||||
New-HVHomeSite -group group@domain -site SITE -globalentitlement GE_Production
|
||||
```
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -Group
|
||||
User principal name of a group
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: Default
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: globalApplicationEntitlement, globalEntitlement
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Site
|
||||
Name of the Horizon View Site
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: Default
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: globalApplicationEntitlement, globalEntitlement
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -globalEntitlement
|
||||
Name of the global entitlement
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: globalEntitlement
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -globalApplicationEntitlement
|
||||
Name of the global application entitlement
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: globalApplicationEntitlement
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -HvServer
|
||||
Reference to Horizon View Server to query the virtual machines from.
|
||||
If the value is not passed or null then
|
||||
first element from global:DefaultHVServers would be considered in-place of hvServer
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
## NOTES
|
||||
| | |
|
||||
|-|-|
|
||||
| Author | Wouter Kursten |
|
||||
| Author email | wouter@retouw.nl |
|
||||
| Version | 1.0 |
|
||||
|
||||
===Tested Against Environment====
|
||||
| | |
|
||||
|-|-|
|
||||
| Horizon View Server Version | 7.4 |
|
||||
| PowerCLI Version | PowerCLI 10.1.1 |
|
||||
| PowerShell Version | 5.0 |
|
||||
|
||||
## RELATED LINKS
|
||||
383
Modules/VMware.Hv.Helper/docs/New-HVManualApplication.md
Executable file
383
Modules/VMware.Hv.Helper/docs/New-HVManualApplication.md
Executable file
@@ -0,0 +1,383 @@
|
||||
---
|
||||
external help file: VMware.HV.Helper-help.xml
|
||||
Module Name: VMware.HV.Helper
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# New-HVManualApplication
|
||||
|
||||
## SYNOPSIS
|
||||
Creates a Manual Application.
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```
|
||||
New-HVManualApplication [-HvServer <ViewServerImpl>] -Name <String> [-DisplayName <String>]
|
||||
[-Description <String>] -ExecutablePath <String> [-Version <String>] [-Publisher <String>]
|
||||
[-Enabled <Boolean>] [-EnablePreLaunch <Boolean>] [-ConnectionServerRestrictions <String[]>]
|
||||
[-CategoryFolderName <String>] [-clientRestrictions <Boolean>] [-ShortcutLocations <String[]>]
|
||||
[-MultiSessionMode <String>] [-MaxMultiSessions <Int32>] [-StartFolder <String>] [-Args <String>]
|
||||
-Farm <String> [-AutoUpdateFileTypes <Boolean>] [-AutoUpdateOtherFileTypes <Boolean>]
|
||||
[-GlobalApplicationEntitlement <String>] [<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
Creates Application manually with given parameters.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### EXAMPLE 1
|
||||
```
|
||||
New-HVManualApplication -Name 'App1' -DisplayName 'DisplayName' -Description 'ApplicationDescription' -ExecutablePath "PathOfTheExecutable" -Version 'AppVersion' -Publisher 'PublisherName' -Farm 'FarmName'
|
||||
```
|
||||
|
||||
Creates a manual application App1 in the farm specified.
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -HvServer
|
||||
View API service object of Connect-HVServer cmdlet.
|
||||
|
||||
```yaml
|
||||
Type: ViewServerImpl
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Name
|
||||
The Application name is the unique identifier used to identify this Application.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -DisplayName
|
||||
The display name is the name that users will see when they connect to view client.
|
||||
If the display name is left blank, it defaults to Name.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: $Name
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Description
|
||||
The description is a set of notes about the Application.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -ExecutablePath
|
||||
Path to Application executable.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Version
|
||||
Application version.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Publisher
|
||||
Application publisher.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Enabled
|
||||
Indicates if Application is enabled.
|
||||
|
||||
```yaml
|
||||
Type: Boolean
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: True
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -EnablePreLaunch
|
||||
Application can be pre-launched if value is true.
|
||||
|
||||
```yaml
|
||||
Type: Boolean
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: False
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -ConnectionServerRestrictions
|
||||
Connection server restrictions.
|
||||
This is a list of tags that access to the application is restricted to.
|
||||
Empty/Null list means that the application can be accessed from any connection server.
|
||||
|
||||
```yaml
|
||||
Type: String[]
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -CategoryFolderName
|
||||
Name of the category folder in the user's OS containing a shortcut to the application.
|
||||
Unset if the application does not belong to a category.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -clientRestrictions
|
||||
Client restrictions to be applied to Application.
|
||||
Currently it is valid for RDSH pools.
|
||||
|
||||
```yaml
|
||||
Type: Boolean
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: False
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -ShortcutLocations
|
||||
Locations of the category folder in the user's OS containing a shortcut to the desktop.
|
||||
The value must be set if categoryFolderName is provided.
|
||||
|
||||
```yaml
|
||||
Type: String[]
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -MultiSessionMode
|
||||
Multi-session mode for the application.
|
||||
An application launched in multi-session mode does not support reconnect behavior when user logs in from a different client instance.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: DISABLED
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -MaxMultiSessions
|
||||
Maximum number of multi-sessions a user can have in this application pool.
|
||||
|
||||
```yaml
|
||||
Type: Int32
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: 0
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -StartFolder
|
||||
Starting folder for Application.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Args
|
||||
Parameters to pass to application when launching.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Farm
|
||||
Farm name.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -AutoUpdateFileTypes
|
||||
Whether or not the file types supported by this application should be allowed to automatically update to reflect changes reported by the agent.
|
||||
|
||||
```yaml
|
||||
Type: Boolean
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: True
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -AutoUpdateOtherFileTypes
|
||||
Whether or not the other file types supported by this application should be allowed to automatically update to reflect changes reported by the agent.
|
||||
|
||||
```yaml
|
||||
Type: Boolean
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: True
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -GlobalApplicationEntitlement
|
||||
The name of a Global Application Entitlement to associate this Application pool with.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### A success message is displayed when done.
|
||||
## NOTES
|
||||
| | |
|
||||
|-|-|
|
||||
Author : Samiullasha S
|
||||
Author email : ssami@vmware.com
|
||||
Version : 1.0
|
||||
|
||||
===Tested Against Environment====
|
||||
| | |
|
||||
|-|-|
|
||||
Horizon View Server Version : 7.8.0
|
||||
PowerCLI Version : PowerCLI 11.1
|
||||
PowerShell Version : 5.0
|
||||
|
||||
## RELATED LINKS
|
||||
72
Modules/VMware.Hv.Helper/docs/New-HVPodFederation.md
Executable file
72
Modules/VMware.Hv.Helper/docs/New-HVPodFederation.md
Executable file
@@ -0,0 +1,72 @@
|
||||
---
|
||||
external help file: VMware.HV.Helper-help.xml
|
||||
Module Name: VMware.HV.Helper
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# New-HVPodFederation
|
||||
|
||||
## SYNOPSIS
|
||||
Initiates a Horizon View Pod Federation (Cloud Pod Architecture)
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```
|
||||
New-HVPodFederation [[-HvServer] <Object>] [<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
Starts the initialisation of a Horizon View Pod Federation.
|
||||
Other pod's can be joined to this federation to form the Cloud Pod Architecture
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### EXAMPLE 1
|
||||
```
|
||||
new-hvpodfederation
|
||||
```
|
||||
|
||||
Returns health for the connectionserver(s)
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -HvServer
|
||||
Reference to Horizon View Server to query the virtual machines from.
|
||||
If the value is not passed or null then
|
||||
first element from global:DefaultHVServers would be considered in-place of hvServer
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
## NOTES
|
||||
| | |
|
||||
|-|-|
|
||||
| Author | Wouter Kursten |
|
||||
| Author email | wouter@retouw.nl |
|
||||
| Version | 1.0 |
|
||||
|
||||
===Tested Against Environment====
|
||||
| | |
|
||||
|-|-|
|
||||
| Horizon View Server Version | 7.3.2,7.4 |
|
||||
| PowerCLI Version | PowerCLI 6.5, PowerCLI 6.5.1 |
|
||||
| PowerShell Version | 5.0 |
|
||||
|
||||
## RELATED LINKS
|
||||
1830
Modules/VMware.Hv.Helper/docs/New-HVPool.md
Executable file
1830
Modules/VMware.Hv.Helper/docs/New-HVPool.md
Executable file
File diff suppressed because it is too large
Load Diff
215
Modules/VMware.Hv.Helper/docs/New-HVPreInstalledApplication.md
Executable file
215
Modules/VMware.Hv.Helper/docs/New-HVPreInstalledApplication.md
Executable file
@@ -0,0 +1,215 @@
|
||||
---
|
||||
external help file: VMware.HV.Helper-help.xml
|
||||
Module Name: VMware.HV.Helper
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# New-HVPreInstalledApplication
|
||||
|
||||
## SYNOPSIS
|
||||
Creates a application pool from Pre-installed applications on RDS Server(s).
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```
|
||||
New-HVPreInstalledApplication -ApplicationName <String> [-ApplicationID <String>] [-DisplayName <String>]
|
||||
-FarmName <String> [-EnablePreLaunch <Boolean>] [-ConnectionServerRestrictions <String[]>]
|
||||
[-CategoryFolderName <String>] [-clientRestrictions <Boolean>] [-HvServer <Object>] [<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
Creates a application pool from Pre-installed applications on RDS Server(s).
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### EXAMPLE 1
|
||||
```
|
||||
New-HVPreInstalledApplication -ApplicationName 'App1' -DisplayName 'DisplayName' -FarmName 'FarmName'
|
||||
```
|
||||
|
||||
Creates a application App1 from the farm specified.
|
||||
|
||||
### EXAMPLE 2
|
||||
```
|
||||
New-HVPreInstalledApplication -ApplicationName 'App2' -FarmName FarmManual -EnablePreLaunch $True
|
||||
```
|
||||
|
||||
Creates a application App2 from the farm specified and the PreLaunch option will be enabled.
|
||||
|
||||
### EXAMPLE 3
|
||||
```
|
||||
New-HVPreInstalledApplication -ApplicationName 'Excel 2016' -ApplicationID 'Excel-2016' -DisplayName 'Excel' -FarmName 'RDS-FARM-01'
|
||||
```
|
||||
|
||||
Creates an application, Excel-2016, from the farm RDS-FARM-01.
|
||||
The application will display as 'Excel' to the end user.
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -ApplicationName
|
||||
The Application name to search within the Farm for.
|
||||
This should match the output of (Get-HVPreinstalledApplication).Name
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -ApplicationID
|
||||
The unique identifier for this application.
|
||||
The ApplicationID can only contain alphanumeric characters, dashes, and underscores.
|
||||
If ApplicationID is not specified, it will be set to match the ApplicationName, with the spaces converted to underscore (_).
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: $($ApplicationName -replace " ","_")
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -DisplayName
|
||||
The display name is the name that users will see when they connect with the Horizon Client.
|
||||
If the display name is left blank, it defaults to ApplicationName.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: $ApplicationName
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -FarmName
|
||||
Farm name.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -EnablePreLaunch
|
||||
Application can be pre-launched if value is true.
|
||||
|
||||
```yaml
|
||||
Type: Boolean
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: False
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -ConnectionServerRestrictions
|
||||
Connection server restrictions.
|
||||
This is a list of tags that access to the application is restricted to.
|
||||
Empty/Null list means that the application can be accessed from any connection server.
|
||||
|
||||
```yaml
|
||||
Type: String[]
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -CategoryFolderName
|
||||
Name of the category folder in the user's OS containing a shortcut to the application.
|
||||
Unset if the application does not belong to a category.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -clientRestrictions
|
||||
Client restrictions to be applied to Application.
|
||||
Currently it is valid for RDSH pools.
|
||||
|
||||
```yaml
|
||||
Type: Boolean
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: False
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -HvServer
|
||||
View API service object of Connect-HVServer cmdlet.
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### A success message is displayed when done.
|
||||
## NOTES
|
||||
| | |
|
||||
|-|-|
|
||||
| Author | Samiullasha S |
|
||||
| Author email | ssami@vmware.com |
|
||||
| Version | 1.0 |
|
||||
|
||||
===Tested Against Environment====
|
||||
| | |
|
||||
|-|-|
|
||||
| Horizon View Server Version | 7.8.0 |
|
||||
| PowerCLI Version | PowerCLI 11.1 |
|
||||
| PowerShell Version | 5.0 |
|
||||
|
||||
## RELATED LINKS
|
||||
101
Modules/VMware.Hv.Helper/docs/New-HVSite.md
Executable file
101
Modules/VMware.Hv.Helper/docs/New-HVSite.md
Executable file
@@ -0,0 +1,101 @@
|
||||
---
|
||||
external help file: VMware.HV.Helper-help.xml
|
||||
Module Name: VMware.HV.Helper
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# New-HVSite
|
||||
|
||||
## SYNOPSIS
|
||||
Creates a new site within a Horizon View Pod Federation (Cloud Pod Architecture)
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```
|
||||
New-HVSite [-name] <String> [-description] <String> [[-HvServer] <Object>] [<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
Creates a new site within a Horizon View Pod Federation (Cloud Pod Architecture)
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### EXAMPLE 1
|
||||
```
|
||||
new-hvsite -name "NAME" -description "DESCRIPTION"
|
||||
```
|
||||
|
||||
Returns information about the sites within a Horizon View Pod Federation.
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -name
|
||||
Name of the site (required)
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -description
|
||||
Description of the site (required)
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 2
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -HvServer
|
||||
Reference to Horizon View Server to query the virtual machines from.
|
||||
If the value is not passed or null then
|
||||
first element from global:DefaultHVServers would be considered in-place of hvServer
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 3
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
## NOTES
|
||||
| | |
|
||||
|-|-|
|
||||
| Author | Wouter Kursten |
|
||||
| Author email | wouter@retouw.nl |
|
||||
| Version | 1.0 |
|
||||
|
||||
===Tested Against Environment====
|
||||
| | |
|
||||
|-|-|
|
||||
| Horizon View Server Version | 7.3.2,7.4 |
|
||||
| PowerCLI Version | PowerCLI 6.5, PowerCLI 6.5.1 |
|
||||
| PowerShell Version | 5.0 |
|
||||
|
||||
## RELATED LINKS
|
||||
127
Modules/VMware.Hv.Helper/docs/Register-HVPod.md
Executable file
127
Modules/VMware.Hv.Helper/docs/Register-HVPod.md
Executable file
@@ -0,0 +1,127 @@
|
||||
---
|
||||
external help file: VMware.HV.Helper-help.xml
|
||||
Module Name: VMware.HV.Helper
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Register-HVPod
|
||||
|
||||
## SYNOPSIS
|
||||
Registers a pod in a Horizon View Pod Federation (Cloud Pod Architecture)
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```
|
||||
Register-HVPod [-remoteconnectionserver] <String> [-ADUserName] <String> [-ADpassword] <SecureString>
|
||||
[[-HvServer] <Object>] [<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
Registers a pod in a Horizon View Pod Federation.
|
||||
You have to be connected to the pod you are joining to the federation.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### EXAMPLE 1
|
||||
```
|
||||
$adpassword = Read-Host 'Domain Password' -AsSecureString
|
||||
```
|
||||
|
||||
register-hvpod -remoteconnectionserver "servername" -username "user\domain" -password $adpassword
|
||||
|
||||
### EXAMPLE 2
|
||||
```
|
||||
register-hvpod -remoteconnectionserver "servername" -username "user\domain"
|
||||
```
|
||||
|
||||
It will now ask for the password
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -remoteconnectionserver
|
||||
Servername of a connectionserver that already belongs to the PodFederation
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -ADUserName
|
||||
User principal name of user this is required to be in the domain\username format
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 2
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -ADpassword
|
||||
Password of the type Securestring.
|
||||
Can be created with:
|
||||
$password = Read-Host 'Domain Password' -AsSecureString
|
||||
|
||||
```yaml
|
||||
Type: SecureString
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 3
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -HvServer
|
||||
Reference to Horizon View Server to query the virtual machines from.
|
||||
If the value is not passed or null then
|
||||
first element from global:DefaultHVServers would be considered in-place of hvServer
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 4
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
## NOTES
|
||||
| | |
|
||||
|-|-|
|
||||
| Author | Wouter Kursten |
|
||||
| Author email | wouter@retouw.nl |
|
||||
| Version | 1.0 |
|
||||
|
||||
===Tested Against Environment====
|
||||
| | |
|
||||
|-|-|
|
||||
| Horizon View Server Version | 7.3.2,7.4 |
|
||||
| PowerCLI Version | PowerCLI 6.5, PowerCLI 6.5.1 |
|
||||
| PowerShell Version | 5.0 |
|
||||
|
||||
## RELATED LINKS
|
||||
118
Modules/VMware.Hv.Helper/docs/Remove-HVApplication.md
Executable file
118
Modules/VMware.Hv.Helper/docs/Remove-HVApplication.md
Executable file
@@ -0,0 +1,118 @@
|
||||
---
|
||||
external help file: VMware.HV.Helper-help.xml
|
||||
Module Name: VMware.HV.Helper
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Remove-HVApplication
|
||||
|
||||
## SYNOPSIS
|
||||
Removes the specified application if exists.
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```
|
||||
Remove-HVApplication [-ApplicationName] <String> [[-HvServer] <Object>] [-WhatIf] [-Confirm]
|
||||
[<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
Removes the specified application if exists.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### EXAMPLE 1
|
||||
```
|
||||
Remove-HVApplication -ApplicationName 'App1' -HvServer $HvServer
|
||||
```
|
||||
|
||||
Removes 'App1', if exists.
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -ApplicationName
|
||||
Application to be deleted.
|
||||
The name of the application must be given that is to be searched for and remove if exists.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -HvServer
|
||||
View API service object of Connect-HVServer cmdlet.
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 2
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -WhatIf
|
||||
Shows what would happen if the cmdlet runs.
|
||||
The cmdlet is not run.
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases: wi
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Confirm
|
||||
Prompts you for confirmation before running the cmdlet.
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases: cf
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### Removes the specified application if exists.
|
||||
## NOTES
|
||||
| | |
|
||||
|-|-|
|
||||
| Author | Samiullasha S |
|
||||
| Author email | ssami@vmware.com |
|
||||
| Version | 1.2 |
|
||||
|
||||
===Tested Against Environment====
|
||||
| | |
|
||||
|-|-|
|
||||
| Horizon View Server Version | 7.8.0 |
|
||||
| PowerCLI Version | PowerCLI 11.1 |
|
||||
| PowerShell Version | 5.0 |
|
||||
|
||||
## RELATED LINKS
|
||||
119
Modules/VMware.Hv.Helper/docs/Remove-HVApplicationIcon.md
Executable file
119
Modules/VMware.Hv.Helper/docs/Remove-HVApplicationIcon.md
Executable file
@@ -0,0 +1,119 @@
|
||||
---
|
||||
external help file: VMware.HV.Helper-help.xml
|
||||
Module Name: VMware.HV.Helper
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Remove-HVApplicationIcon
|
||||
|
||||
## SYNOPSIS
|
||||
Used to remove a customized icon association for a given application.
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```
|
||||
Remove-HVApplicationIcon [-ApplicationName] <String> [[-HvServer] <Object>] [-WhatIf] [-Confirm]
|
||||
[<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
This function is used to remove an application association to the given application.
|
||||
It will never remove the RDS system icons.
|
||||
If application doesnot have any customized icon, an error will be thrown.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### EXAMPLE 1
|
||||
```
|
||||
Removing the icon for an application A1.
|
||||
```
|
||||
|
||||
Remove-HVApplicationIcon -ApplicationName A1 -HvServer $hvServer
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -ApplicationName
|
||||
Name of the application to which customized icon needs to be removed.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -HvServer
|
||||
View API service object of Connect-HVServer cmdlet.
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 2
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -WhatIf
|
||||
Shows what would happen if the cmdlet runs.
|
||||
The cmdlet is not run.
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases: wi
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Confirm
|
||||
Prompts you for confirmation before running the cmdlet.
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases: cf
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### None
|
||||
## NOTES
|
||||
| | |
|
||||
|-|-|
|
||||
| Author | Paramesh Oddepally. |
|
||||
| Author email | poddepally@vmware.com |
|
||||
| Version | 1.1 |
|
||||
|
||||
===Tested Against Environment====
|
||||
| | |
|
||||
|-|-|
|
||||
| Horizon View Server Version | 7.1 |
|
||||
| PowerCLI Version | PowerCLI 6.5.1 |
|
||||
| PowerShell Version | 5.0 |
|
||||
|
||||
## RELATED LINKS
|
||||
178
Modules/VMware.Hv.Helper/docs/Remove-HVEntitlement.md
Executable file
178
Modules/VMware.Hv.Helper/docs/Remove-HVEntitlement.md
Executable file
@@ -0,0 +1,178 @@
|
||||
---
|
||||
external help file: VMware.HV.Helper-help.xml
|
||||
Module Name: VMware.HV.Helper
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Remove-HVEntitlement
|
||||
|
||||
## SYNOPSIS
|
||||
Deletes association data between a user/group and a resource
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```
|
||||
Remove-HVEntitlement [-User] <String> [-ResourceName] <String> [[-Type] <String>] [[-ResourceType] <String>]
|
||||
[[-HvServer] <Object>] [-WhatIf] [-Confirm] [<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
Removes entitlement between a single user/group and a resource that already been assigned.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### EXAMPLE 1
|
||||
```
|
||||
Remove-HVEntitlement -User 'administrator@adviewdev' -ResourceName LnkClnJSon -Confirm:$false
|
||||
```
|
||||
|
||||
Deletes entitlement between a user/group and a pool resource
|
||||
|
||||
### EXAMPLE 2
|
||||
```
|
||||
Remove-HVEntitlement -User 'adviewdev\puser2' -ResourceName 'calculator' -ResourceType Application
|
||||
```
|
||||
|
||||
Deletes entitlement between a user/group and a Application resource
|
||||
|
||||
### EXAMPLE 3
|
||||
```
|
||||
Remove-HVEntitlement -User 'adviewdev\administrator' -ResourceName 'GEAPP1' -ResourceType GlobalApplicationEntitlement
|
||||
```
|
||||
|
||||
Deletes entitlement between a user/group and a GlobalApplicationEntitlement resource
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -User
|
||||
User principal name of user or group
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -ResourceName
|
||||
The resource(Application, Desktop etc.) name.
|
||||
Supports only wildcard character '*' when resource type is desktop.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 2
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Type
|
||||
Whether or not this is a group or a user.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 3
|
||||
Default value: User
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -ResourceType
|
||||
Type of Resource(Application, Desktop etc)
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 4
|
||||
Default value: Desktop
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -HvServer
|
||||
Reference to Horizon View Server.
|
||||
If the value is not passed or null then
|
||||
first element from global:DefaultHVServers would be considered in-place of hvServer
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 5
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -WhatIf
|
||||
Shows what would happen if the cmdlet runs.
|
||||
The cmdlet is not run.
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases: wi
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Confirm
|
||||
Prompts you for confirmation before running the cmdlet.
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases: cf
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
## NOTES
|
||||
| | |
|
||||
|-|-|
|
||||
| Author | Praveen Mathamsetty. |
|
||||
| Author email | pmathamsetty@vmware.com |
|
||||
| Version | 1.1 |
|
||||
|
||||
===Tested Against Environment====
|
||||
| | |
|
||||
|-|-|
|
||||
| Horizon View Server Version | 7.0.2, 7.1.0 |
|
||||
| PowerCLI Version | PowerCLI 6.5, PowerCLI 6.5.1 |
|
||||
| PowerShell Version | 5.0 |
|
||||
|
||||
## RELATED LINKS
|
||||
158
Modules/VMware.Hv.Helper/docs/Remove-HVFarm.md
Executable file
158
Modules/VMware.Hv.Helper/docs/Remove-HVFarm.md
Executable file
@@ -0,0 +1,158 @@
|
||||
---
|
||||
external help file: VMware.HV.Helper-help.xml
|
||||
Module Name: VMware.HV.Helper
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Remove-HVFarm
|
||||
|
||||
## SYNOPSIS
|
||||
Deletes specified farm(s).
|
||||
|
||||
## SYNTAX
|
||||
|
||||
### option
|
||||
```
|
||||
Remove-HVFarm -FarmName <String> [-HvServer <Object>] [-WhatIf] [-Confirm] [<CommonParameters>]
|
||||
```
|
||||
|
||||
### pipeline
|
||||
```
|
||||
Remove-HVFarm -Farm <Object> [-HvServer <Object>] [-WhatIf] [-Confirm] [<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
This function deletes the farm(s) with the specified name/object(s) from the Connection Server.
|
||||
Optionally, user can pipe the farm object(s) as input to this function.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### EXAMPLE 1
|
||||
```
|
||||
Remove-HVFarm -FarmName 'Farm-01' -HvServer $hvServer -Confirm:$false
|
||||
```
|
||||
|
||||
Delete a given farm.
|
||||
For an automated farm, all the RDS Server VMs are deleted from disk whereas for a manual farm only the RDS Server associations are removed.
|
||||
|
||||
### EXAMPLE 2
|
||||
```
|
||||
$farm_array | Remove-HVFarm -HvServer $hvServer
|
||||
```
|
||||
|
||||
Deletes a given Farm object(s).
|
||||
For an automated farm, all the RDS Server VMs are deleted from disk whereas for a manual farm only the RDS Server associations are removed.
|
||||
|
||||
### EXAMPLE 3
|
||||
```
|
||||
$farm1 = Get-HVFarm -FarmName 'Farm-01'
|
||||
```
|
||||
|
||||
Remove-HVFarm -Farm $farm1
|
||||
Deletes a given Farm object.
|
||||
For an automated farm, all the RDS Server VMs are deleted from disk whereas for a manual farm only the RDS Server associations are removed.
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -FarmName
|
||||
Name of the farm to be deleted.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: option
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Farm
|
||||
Object(s) of the farm to be deleted.
|
||||
Object(s) should be of type FarmSummaryView/FarmInfo.
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: pipeline
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -HvServer
|
||||
Reference to Horizon View Server to query the data from.
|
||||
If the value is not passed or null then first element from global:DefaultHVServers would be considered in-place of hvServer.
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -WhatIf
|
||||
Shows what would happen if the cmdlet runs.
|
||||
The cmdlet is not run.
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases: wi
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Confirm
|
||||
Prompts you for confirmation before running the cmdlet.
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases: cf
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### None
|
||||
## NOTES
|
||||
| | |
|
||||
|-|-|
|
||||
| Author | praveen mathamsetty. |
|
||||
| Author email | pmathamsetty@vmware.com |
|
||||
| Version | 1.1 |
|
||||
|
||||
===Tested Against Environment====
|
||||
| | |
|
||||
|-|-|
|
||||
| Horizon View Server Version | 7.0.2, 7.1.0 |
|
||||
| PowerCLI Version | PowerCLI 6.5, PowerCLI 6.5.1 |
|
||||
| PowerShell Version | 5.0 |
|
||||
|
||||
## RELATED LINKS
|
||||
147
Modules/VMware.Hv.Helper/docs/Remove-HVGlobalEntitlement.md
Executable file
147
Modules/VMware.Hv.Helper/docs/Remove-HVGlobalEntitlement.md
Executable file
@@ -0,0 +1,147 @@
|
||||
---
|
||||
external help file: VMware.HV.Helper-help.xml
|
||||
Module Name: VMware.HV.Helper
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Remove-HVGlobalEntitlement
|
||||
|
||||
## SYNOPSIS
|
||||
Deletes a Global Entitlement.
|
||||
|
||||
## SYNTAX
|
||||
|
||||
### Default
|
||||
```
|
||||
Remove-HVGlobalEntitlement -DisplayName <String> [-HvServer <Object>] [-WhatIf] [-Confirm] [<CommonParameters>]
|
||||
```
|
||||
|
||||
### pipeline
|
||||
```
|
||||
Remove-HVGlobalEntitlement -GlobalEntitlement <Object> [-HvServer <Object>] [-WhatIf] [-Confirm]
|
||||
[<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
Deletes global entitlement(s) and global application entitlement(s).
|
||||
Optionally, user can pipe the global entitlement(s) as input to this function.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### EXAMPLE 1
|
||||
```
|
||||
Remove-HVGlobalEntitlement -DisplayName 'GE_APP'
|
||||
```
|
||||
|
||||
Deletes global application/desktop entitlement with displayName 'GE_APP'
|
||||
|
||||
### EXAMPLE 2
|
||||
```
|
||||
Get-HVGlobalEntitlement -DisplayName 'GE_*' | Remove-HVGlobalEntitlement
|
||||
```
|
||||
|
||||
Deletes global application/desktop entitlement(s), if displayName matches with 'GE_*'
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -DisplayName
|
||||
Display Name of Global Entitlement.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: Default
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -GlobalEntitlement
|
||||
{{ Fill GlobalEntitlement Description }}
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: pipeline
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -HvServer
|
||||
Reference to Horizon View Server.
|
||||
If the value is not passed or null then
|
||||
first element from global:DefaultHVServers would be considered inplace of hvServer
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -WhatIf
|
||||
Shows what would happen if the cmdlet runs.
|
||||
The cmdlet is not run.
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases: wi
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Confirm
|
||||
Prompts you for confirmation before running the cmdlet.
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases: cf
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
## NOTES
|
||||
| | |
|
||||
|-|-|
|
||||
| Author | Praveen Mathamsetty. |
|
||||
| Author email | pmathamsetty@vmware.com |
|
||||
| Version | 1.1 |
|
||||
|
||||
===Tested Against Environment====
|
||||
| | |
|
||||
|-|-|
|
||||
| Horizon View Server Version | 7.0.2, 7.1.0 |
|
||||
| PowerCLI Version | PowerCLI 6.5, PowerCLI 6.5.1 |
|
||||
| PowerShell Version | 5.0 |
|
||||
|
||||
## RELATED LINKS
|
||||
154
Modules/VMware.Hv.Helper/docs/Remove-HVMachine.md
Executable file
154
Modules/VMware.Hv.Helper/docs/Remove-HVMachine.md
Executable file
@@ -0,0 +1,154 @@
|
||||
---
|
||||
external help file: VMware.HV.Helper-help.xml
|
||||
Module Name: VMware.HV.Helper
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Remove-HVMachine
|
||||
|
||||
## SYNOPSIS
|
||||
Remove a Horizon View desktop or desktops.
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```
|
||||
Remove-HVMachine [-MachineNames] <Array> [-DeleteFromDisk] [[-HVServer] <Object>] [-WhatIf] [-Confirm]
|
||||
[<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
Deletes a VM or an array of VM's from Horizon.
|
||||
Utilizes an Or query filter to match machine names.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### EXAMPLE 1
|
||||
```
|
||||
Remove-HVMachine -HVServer 'horizonserver123' -MachineNames 'LAX-WIN10-002'
|
||||
```
|
||||
|
||||
Deletes VM 'LAX-WIN10-002' from HV Server 'horizonserver123'
|
||||
|
||||
### EXAMPLE 2
|
||||
```
|
||||
Remove-HVMachine -HVServer 'horizonserver123' -MachineNames $machines
|
||||
```
|
||||
|
||||
Deletes VM's contained within an array of machine names from HV Server 'horizonserver123'
|
||||
|
||||
### EXAMPLE 3
|
||||
```
|
||||
Remove-HVMachine -HVServer 'horizonserver123' -MachineNames 'ManualVM01' -DeleteFromDisk:$false
|
||||
```
|
||||
|
||||
Deletes VM 'ManualVM01' from Horizon inventory, but not from vSphere.
|
||||
Note this only works for Full Clone VMs.
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -MachineNames
|
||||
The name or names of the machine(s) to be deleted.
|
||||
Accepts a single VM or an array of VM names.This is a mandatory parameter.
|
||||
|
||||
```yaml
|
||||
Type: Array
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -DeleteFromDisk
|
||||
Determines whether the Machine VM should be deleted from vCenter Server.
|
||||
This is only applicable for managed machines.
|
||||
This must always be true for machines in linked and instant clone desktops.
|
||||
This defaults to true for linked and instant clone machines and false for all other types.
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: False
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -HVServer
|
||||
The Horizon server where the machine to be deleted resides.
|
||||
Parameter is not mandatory,
|
||||
but if you do not specify the server, than make sure you are connected to a Horizon server
|
||||
first with connect-hvserver.
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 2
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -WhatIf
|
||||
Shows what would happen if the cmdlet runs.
|
||||
The cmdlet is not run.
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases: wi
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Confirm
|
||||
Prompts you for confirmation before running the cmdlet.
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases: cf
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
## NOTES
|
||||
| | |
|
||||
|-|-|
|
||||
| Author | Jose Rodriguez |
|
||||
| Author email | jrodsguitar@gmail.com |
|
||||
| Version | 1.0 |
|
||||
|
||||
===Tested Against Environment====
|
||||
| | |
|
||||
|-|-|
|
||||
| Horizon View Server Version | 7.1.1 |
|
||||
| PowerCLI Version | PowerCLI 6.5, PowerCLI 6.5.1 |
|
||||
| PowerShell Version | 5.0 |
|
||||
|
||||
## RELATED LINKS
|
||||
72
Modules/VMware.Hv.Helper/docs/Remove-HVPodFederation.md
Executable file
72
Modules/VMware.Hv.Helper/docs/Remove-HVPodFederation.md
Executable file
@@ -0,0 +1,72 @@
|
||||
---
|
||||
external help file: VMware.HV.Helper-help.xml
|
||||
Module Name: VMware.HV.Helper
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Remove-HVPodFederation
|
||||
|
||||
## SYNOPSIS
|
||||
Uninitiates a Horizon View Pod Federation (Cloud Pod Architecture)
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```
|
||||
Remove-HVPodFederation [[-HvServer] <Object>] [<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
Starts the uninitialisation of a Horizon View Pod Federation.
|
||||
It does NOT remove a pod from a federation.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### EXAMPLE 1
|
||||
```
|
||||
Starts the Uninitiates a Horizon View Pod Federation.
|
||||
```
|
||||
|
||||
Unintialises
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -HvServer
|
||||
Reference to Horizon View Server to query the virtual machines from.
|
||||
If the value is not passed or null then
|
||||
first element from global:DefaultHVServers would be considered in-place of hvServer
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
## NOTES
|
||||
| | |
|
||||
|-|-|
|
||||
| Author | Wouter Kursten |
|
||||
| Author email | wouter@retouw.nl |
|
||||
| Version | 1.0 |
|
||||
|
||||
===Tested Against Environment====
|
||||
| | |
|
||||
|-|-|
|
||||
| Horizon View Server Version | 7.3.2,7.4 |
|
||||
| PowerCLI Version | PowerCLI 6.5, PowerCLI 6.5.1 |
|
||||
| PowerShell Version | 5.0 |
|
||||
|
||||
## RELATED LINKS
|
||||
186
Modules/VMware.Hv.Helper/docs/Remove-HVPool.md
Executable file
186
Modules/VMware.Hv.Helper/docs/Remove-HVPool.md
Executable file
@@ -0,0 +1,186 @@
|
||||
---
|
||||
external help file: VMware.HV.Helper-help.xml
|
||||
Module Name: VMware.HV.Helper
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Remove-HVPool
|
||||
|
||||
## SYNOPSIS
|
||||
Deletes specified pool(s).
|
||||
|
||||
## SYNTAX
|
||||
|
||||
### option
|
||||
```
|
||||
Remove-HVPool -poolName <String> [-TerminateSession] [-DeleteFromDisk] [-HvServer <Object>] [-WhatIf]
|
||||
[-Confirm] [<CommonParameters>]
|
||||
```
|
||||
|
||||
### pipeline
|
||||
```
|
||||
Remove-HVPool [-Pool <Object>] [-TerminateSession] [-DeleteFromDisk] [-HvServer <Object>] [-WhatIf] [-Confirm]
|
||||
[<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
This function deletes the pool(s) with the specified name/object(s) from Connection Server.
|
||||
This can be used for deleting any pool irrespective of its type.
|
||||
Optionally, user can pipe the pool object(s) as input to this function.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### EXAMPLE 1
|
||||
```
|
||||
Remove-HVPool -HvServer $hvServer -PoolName 'FullClone' -DeleteFromDisk -Confirm:$false
|
||||
```
|
||||
|
||||
Deletes pool from disk with given parameters PoolName etc.
|
||||
|
||||
### EXAMPLE 2
|
||||
```
|
||||
$pool_array | Remove-HVPool -HvServer $hvServer -DeleteFromDisk
|
||||
```
|
||||
|
||||
Deletes specified pool from disk
|
||||
|
||||
### EXAMPLE 3
|
||||
```
|
||||
Remove-HVPool -Pool $pool1
|
||||
```
|
||||
|
||||
Deletes specified pool and VM(s) associations are removed from view Manager
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -poolName
|
||||
Name of the pool to be deleted.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: option
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Pool
|
||||
Object(s) of the pool to be deleted.
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: pipeline
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -TerminateSession
|
||||
Logs off a session forcibly to virtual machine(s).
|
||||
This operation will also log off a locked session.
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: False
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -DeleteFromDisk
|
||||
Switch parameter to delete the virtual machine(s) from the disk.
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: False
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -HvServer
|
||||
View API service object of Connect-HVServer cmdlet.
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -WhatIf
|
||||
Shows what would happen if the cmdlet runs.
|
||||
The cmdlet is not run.
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases: wi
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Confirm
|
||||
Prompts you for confirmation before running the cmdlet.
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases: cf
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### None
|
||||
## NOTES
|
||||
| | |
|
||||
|-|-|
|
||||
| Author | Praveen Mathamsetty. |
|
||||
| Author email | pmathamsetty@vmware.com |
|
||||
| Version | 1.1 |
|
||||
|
||||
===Tested Against Environment====
|
||||
| | |
|
||||
|-|-|
|
||||
| Horizon View Server Version | 7.0.2, 7.1.0 |
|
||||
| PowerCLI Version | PowerCLI 6.5, PowerCLI 6.5.1 |
|
||||
| PowerShell Version | 5.0 |
|
||||
|
||||
## RELATED LINKS
|
||||
86
Modules/VMware.Hv.Helper/docs/Remove-HVSite.md
Executable file
86
Modules/VMware.Hv.Helper/docs/Remove-HVSite.md
Executable file
@@ -0,0 +1,86 @@
|
||||
---
|
||||
external help file: VMware.HV.Helper-help.xml
|
||||
Module Name: VMware.HV.Helper
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Remove-HVSite
|
||||
|
||||
## SYNOPSIS
|
||||
renames a new site within a Horizon View Pod Federation (Cloud Pod Architecture)
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```
|
||||
Remove-HVSite [-name] <String> [[-HvServer] <Object>] [<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
renames a new site within a Horizon View Pod Federation (Cloud Pod Architecture)
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### EXAMPLE 1
|
||||
```
|
||||
set-hvsite -site "CURRENTSITENAME" -name "NAME" -description "DESCRIPTION"
|
||||
```
|
||||
|
||||
Returns information about the sites within a Horizon View Pod Federation.
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -name
|
||||
Name of the site (required)
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -HvServer
|
||||
Reference to Horizon View Server to query the virtual machines from.
|
||||
If the value is not passed or null then
|
||||
first element from global:DefaultHVServers would be considered in-place of hvServer
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 2
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
## NOTES
|
||||
| | |
|
||||
|-|-|
|
||||
| Author | Wouter Kursten |
|
||||
| Author email | wouter@retouw.nl |
|
||||
| Version | 1.0 |
|
||||
|
||||
===Tested Against Environment====
|
||||
| | |
|
||||
|-|-|
|
||||
| Horizon View Server Version | 7.3.2,7.4 |
|
||||
| PowerCLI Version | PowerCLI 6.5, PowerCLI 6.5.1 |
|
||||
| PowerShell Version | 5.0 |
|
||||
|
||||
## RELATED LINKS
|
||||
129
Modules/VMware.Hv.Helper/docs/Reset-HVMachine.md
Executable file
129
Modules/VMware.Hv.Helper/docs/Reset-HVMachine.md
Executable file
@@ -0,0 +1,129 @@
|
||||
---
|
||||
external help file: VMware.HV.Helper-help.xml
|
||||
Module Name: VMware.HV.Helper
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Reset-HVMachine
|
||||
|
||||
## SYNOPSIS
|
||||
Resets Horizon View desktops.
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```
|
||||
Reset-HVMachine [-MachineName] <String> [[-HvServer] <Object>] [-WhatIf] [-Confirm] [<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
Queries and resets virtual machines, the machines list would be determined
|
||||
based on queryable fields machineName.
|
||||
Use an asterisk (*) as wildcard.
|
||||
If the result has multiple machines all will be reset.
|
||||
Please note that on an Instant Clone Pool this will do the same as a recover of the machine.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### EXAMPLE 1
|
||||
```
|
||||
reset-HVMachine -MachineName 'PowerCLIVM'
|
||||
```
|
||||
|
||||
Queries VM(s) with given parameter machineName
|
||||
|
||||
### EXAMPLE 2
|
||||
```
|
||||
reset-HVMachine -MachineName 'PowerCLIVM*'
|
||||
```
|
||||
|
||||
Queries VM(s) with given parameter machinename with wildcard character *
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -MachineName
|
||||
The name of the Machine(s) to query for.
|
||||
This is a required value.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -HvServer
|
||||
Reference to Horizon View Server to query the virtual machines from.
|
||||
If the value is not passed or null then
|
||||
first element from global:DefaultHVServers would be considered in-place of hvServer
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 2
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -WhatIf
|
||||
Shows what would happen if the cmdlet runs.
|
||||
The cmdlet is not run.
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases: wi
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Confirm
|
||||
Prompts you for confirmation before running the cmdlet.
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases: cf
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
## NOTES
|
||||
| | |
|
||||
|-|-|
|
||||
| Author | Wouter Kursten |
|
||||
| Author email | wouter@retouw.nl |
|
||||
| Version | 1.0 |
|
||||
|
||||
===Tested Against Environment====
|
||||
| | |
|
||||
|-|-|
|
||||
| Horizon View Server Version | 7.3.2 |
|
||||
| PowerCLI Version | PowerCLI 6.5, PowerCLI 6.5.1 |
|
||||
| PowerShell Version | 5.0 |
|
||||
|
||||
## RELATED LINKS
|
||||
340
Modules/VMware.Hv.Helper/docs/Set-HVApplication.md
Executable file
340
Modules/VMware.Hv.Helper/docs/Set-HVApplication.md
Executable file
@@ -0,0 +1,340 @@
|
||||
---
|
||||
external help file: VMware.HV.Helper-help.xml
|
||||
Module Name: VMware.HV.Helper
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Set-HVApplication
|
||||
|
||||
## SYNOPSIS
|
||||
Updates settings for an existing Application Pool.
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```
|
||||
Set-HVApplication [-HvServer <ViewServerImpl>] [-Name] <String> [-DisplayName <String>] [-Description <String>]
|
||||
[-ExecutablePath <String>] [-Version <String>] [-Publisher <String>] [-Enabled <Boolean>]
|
||||
[-EnablePreLaunch <Boolean>] [-ConnectionServerRestrictions <String[]>] [-CategoryFolderName <String>]
|
||||
[-clientRestrictions <Boolean>] [-ShortcutLocations <String[]>] [-StartFolder <String>] [-Args <String>]
|
||||
[-AutoUpdateFileTypes <Boolean>] [-AutoUpdateOtherFileTypes <Boolean>]
|
||||
[-GlobalApplicationEntitlement <String>] [<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
Updates settings for an existing Application Pool.
|
||||
It does not update the Application Icon.
|
||||
See Set-HVApplicationIcon for a function to update icons.
|
||||
This function specifically targets ApplicationInfo.Data and Application.ExecutionData properties.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### EXAMPLE 1
|
||||
```
|
||||
New-HVManualApplication -Name 'App1' -DisplayName 'DisplayName' -Description 'ApplicationDescription' -ExecutablePath "PathOfTheExecutable" -Version 'AppVersion' -Publisher 'PublisherName' -Farm 'FarmName'
|
||||
```
|
||||
|
||||
Creates a manual application App1 in the farm specified.
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -HvServer
|
||||
View API service object of Connect-HVServer cmdlet.
|
||||
|
||||
```yaml
|
||||
Type: ViewServerImpl
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Name
|
||||
The Application name is the unique identifier used to identify this Application.
|
||||
This cannot be updated but is used to specify which application should be updated.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -DisplayName
|
||||
The display name is the name that users will see when they connect to view client.
|
||||
If the display name is left blank, it defaults to Name.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: $Name
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Description
|
||||
The description is a set of notes about the Application.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -ExecutablePath
|
||||
Path to Application executable.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Version
|
||||
Application version.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Publisher
|
||||
Application publisher.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Enabled
|
||||
Indicates if Application is enabled.
|
||||
|
||||
```yaml
|
||||
Type: Boolean
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: True
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -EnablePreLaunch
|
||||
Application can be pre-launched if value is true.
|
||||
|
||||
```yaml
|
||||
Type: Boolean
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: False
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -ConnectionServerRestrictions
|
||||
Connection server restrictions.
|
||||
This is a list of tags that access to the application is restricted to.
|
||||
Empty/Null list means that the application can be accessed from any connection server.
|
||||
|
||||
```yaml
|
||||
Type: String[]
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -CategoryFolderName
|
||||
Name of the category folder in the user's OS containing a shortcut to the application.
|
||||
Unset if the application does not belong to a category.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -clientRestrictions
|
||||
Client restrictions to be applied to Application.
|
||||
Currently it is valid for RDSH pools.
|
||||
|
||||
```yaml
|
||||
Type: Boolean
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: False
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -ShortcutLocations
|
||||
Locations of the category folder in the user's OS containing a shortcut to the desktop.
|
||||
The value must be set if categoryFolderName is provided.
|
||||
|
||||
```yaml
|
||||
Type: String[]
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -StartFolder
|
||||
Starting folder for Application.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Args
|
||||
Parameters to pass to application when launching.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -AutoUpdateFileTypes
|
||||
Whether or not the file types supported by this application should be allowed to automatically update to reflect changes reported by the agent.
|
||||
|
||||
```yaml
|
||||
Type: Boolean
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: True
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -AutoUpdateOtherFileTypes
|
||||
Whether or not the other file types supported by this application should be allowed to automatically update to reflect changes reported by the agent.
|
||||
|
||||
```yaml
|
||||
Type: Boolean
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: True
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -GlobalApplicationEntitlement
|
||||
The name of a Global Application Entitlement to associate this Application pool with.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### A success message is displayed when done.
|
||||
## NOTES
|
||||
| | |
|
||||
|-|-|
|
||||
| Author | Matt Frey |
|
||||
| Author email | mfrey@vmware.com |
|
||||
| Version | 1.0 |
|
||||
|
||||
===Tested Against Environment====
|
||||
| | |
|
||||
|-|-|
|
||||
| Horizon View Server Version | 7.8.0 |
|
||||
| PowerCLI Version | PowerCLI 11.1 |
|
||||
| PowerShell Version | 5.1 |
|
||||
|
||||
## RELATED LINKS
|
||||
134
Modules/VMware.Hv.Helper/docs/Set-HVApplicationIcon.md
Executable file
134
Modules/VMware.Hv.Helper/docs/Set-HVApplicationIcon.md
Executable file
@@ -0,0 +1,134 @@
|
||||
---
|
||||
external help file: VMware.HV.Helper-help.xml
|
||||
Module Name: VMware.HV.Helper
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Set-HVApplicationIcon
|
||||
|
||||
## SYNOPSIS
|
||||
Used to create/update an icon association for a given application.
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```
|
||||
Set-HVApplicationIcon [-ApplicationName] <String> [-IconPath] <Object> [[-HvServer] <Object>] [-WhatIf]
|
||||
[-Confirm] [<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
This function is used to create an application icon and associate it with the given application.
|
||||
If the specified icon already exists in the LDAP, it will just updates the icon association to the application.
|
||||
Any of the existing customized icon association to the given application will be overwritten.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### EXAMPLE 1
|
||||
```
|
||||
Creating the icon I1 and associating with application A1. Same command is used for update icon also.
|
||||
```
|
||||
|
||||
Set-HVApplicationIcon -ApplicationName A1 -IconPath C:\I1.ico -HvServer $hvServer
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -ApplicationName
|
||||
Name of the application to which the association to be made.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -IconPath
|
||||
Path of the icon.
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 2
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -HvServer
|
||||
View API service object of Connect-HVServer cmdlet.
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 3
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -WhatIf
|
||||
Shows what would happen if the cmdlet runs.
|
||||
The cmdlet is not run.
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases: wi
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Confirm
|
||||
Prompts you for confirmation before running the cmdlet.
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases: cf
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### None
|
||||
## NOTES
|
||||
| | |
|
||||
|-|-|
|
||||
| Author | Paramesh Oddepally. |
|
||||
| Author email | poddepally@vmware.com |
|
||||
| Version | 1.1 |
|
||||
|
||||
===Tested Against Environment====
|
||||
| | |
|
||||
|-|-|
|
||||
| Horizon View Server Version | 7.1 |
|
||||
| PowerCLI Version | PowerCLI 6.5.1 |
|
||||
| PowerShell Version | 5.0 |
|
||||
|
||||
## RELATED LINKS
|
||||
212
Modules/VMware.Hv.Helper/docs/Set-HVEventDatabase.md
Executable file
212
Modules/VMware.Hv.Helper/docs/Set-HVEventDatabase.md
Executable file
@@ -0,0 +1,212 @@
|
||||
---
|
||||
external help file: VMware.HV.Helper-help.xml
|
||||
Module Name: VMware.HV.Helper
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Set-HVEventDatabase
|
||||
|
||||
## SYNOPSIS
|
||||
Registers or changes a Horizon View Event database.
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```
|
||||
Set-HVEventDatabase [-ServerName] <String> [[-DatabaseType] <String>] [[-DatabasePort] <Int32>]
|
||||
[-DatabaseName] <String> [[-TablePrefix] <String>] [-UserName] <String> [-password] <SecureString>
|
||||
[[-eventtime] <String>] [[-eventnewtime] <Int32>] [[-HvServer] <Object>] [<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
Registers or changes a Horizon View Event database
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### EXAMPLE 1
|
||||
```
|
||||
register-hveventdatabase -server SERVER@domain -database DATABASENAME -username USER@domain -password $password
|
||||
```
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -ServerName
|
||||
Name of the database server (Required)
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -DatabaseType
|
||||
Database type, possible options: MYSQL,SQLSERVER,ORACLE.
|
||||
Defaults to SQLSERVER
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 2
|
||||
Default value: SQLSERVER
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -DatabasePort
|
||||
Port number on the database server to which View will send events.
|
||||
Defaults to 1433.
|
||||
|
||||
```yaml
|
||||
Type: Int32
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 3
|
||||
Default value: 1433
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -DatabaseName
|
||||
Name of the Database (required)
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 4
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -TablePrefix
|
||||
Prefix to use for the Event Databse.
|
||||
Allowed characters are letters, numbers, and the characters @, $, #, _, and may not be longer than 6 characters.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 5
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -UserName
|
||||
UserName to connect to the database (required)
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 6
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -password
|
||||
Password of the user connecting to the database in Securestring format.
|
||||
Can be created with: $password = Read-Host 'Domain Password' -AsSecureString
|
||||
|
||||
```yaml
|
||||
Type: SecureString
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 7
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -eventtime
|
||||
Time to show the events for.
|
||||
Possible options are ONE_WEEK, TWO_WEEKS, THREE_WEEKS, ONE_MONTH,TWO_MONTHS, THREE_MONTHS, SIX_MONTHS
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 8
|
||||
Default value: TWO_WEEKS
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -eventnewtime
|
||||
Time in days to classify events for new.
|
||||
Range 1-3
|
||||
|
||||
```yaml
|
||||
Type: Int32
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 9
|
||||
Default value: 2
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -HvServer
|
||||
Reference to Horizon View Server to query the virtual machines from.
|
||||
If the value is not passed or null then
|
||||
first element from global:DefaultHVServers would be considered in-place of hvServer
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 10
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
## NOTES
|
||||
| | |
|
||||
|-|-|
|
||||
| Author | Wouter Kursten |
|
||||
| Author email | wouter@retouw.nl |
|
||||
| Version | 1.0 |
|
||||
|
||||
===Tested Against Environment====
|
||||
| | |
|
||||
|-|-|
|
||||
| Horizon View Server Version | 7.4 |
|
||||
| PowerCLI Version | PowerCLI 10 |
|
||||
| PowerShell Version | 5.0 |
|
||||
|
||||
## RELATED LINKS
|
||||
279
Modules/VMware.Hv.Helper/docs/Set-HVFarm.md
Executable file
279
Modules/VMware.Hv.Helper/docs/Set-HVFarm.md
Executable file
@@ -0,0 +1,279 @@
|
||||
---
|
||||
external help file: VMware.HV.Helper-help.xml
|
||||
Module Name: VMware.HV.Helper
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Set-HVFarm
|
||||
|
||||
## SYNOPSIS
|
||||
Edit farm configuration by passing key/values as parameters/json.
|
||||
|
||||
## SYNTAX
|
||||
|
||||
### option
|
||||
```
|
||||
Set-HVFarm -FarmName <String> [-Enable] [-Disable] [-Start] [-Stop] [-Key <String>] [-Value <Object>]
|
||||
[-Spec <String>] [-HvServer <Object>] [-WhatIf] [-Confirm] [<CommonParameters>]
|
||||
```
|
||||
|
||||
### pipeline
|
||||
```
|
||||
Set-HVFarm [-Farm <Object>] [-Enable] [-Disable] [-Start] [-Stop] [-Key <String>] [-Value <Object>]
|
||||
[-Spec <String>] [-HvServer <Object>] [-WhatIf] [-Confirm] [<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
This function allows user to edit farm configuration by passing key/value pairs.
|
||||
Optionally, user can pass a JSON spec file.
|
||||
User can also pipe the farm object(s) as input to this function.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### EXAMPLE 1
|
||||
```
|
||||
Set-HVFarm -FarmName 'Farm-01' -Spec 'C:\Edit-HVFarm\ManualEditFarm.json' -Confirm:$false
|
||||
```
|
||||
|
||||
Updates farm configuration by using json file
|
||||
|
||||
### EXAMPLE 2
|
||||
```
|
||||
Set-HVFarm -FarmName 'Farm-01' -Key 'base.description' -Value 'updated description'
|
||||
```
|
||||
|
||||
Updates farm configuration with given parameters key and value
|
||||
|
||||
### EXAMPLE 3
|
||||
```
|
||||
$farm_array | Set-HVFarm -Key 'base.description' -Value 'updated description'
|
||||
```
|
||||
|
||||
Updates farm(s) configuration with given parameters key and value
|
||||
|
||||
### EXAMPLE 4
|
||||
```
|
||||
Set-HVFarm -farm 'Farm2' -Start
|
||||
```
|
||||
|
||||
Enables provisioning to specified farm
|
||||
|
||||
### EXAMPLE 5
|
||||
```
|
||||
Set-HVFarm -farm 'Farm2' -Enable
|
||||
```
|
||||
|
||||
Enables specified farm
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -FarmName
|
||||
Name of the farm to edit.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: option
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Farm
|
||||
Object(s) of the farm to edit.
|
||||
Object(s) should be of type FarmSummaryView/FarmInfo.
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: pipeline
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Enable
|
||||
Switch to enable the farm(s).
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: False
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Disable
|
||||
Switch to disable the farm(s).
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: False
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Start
|
||||
Switch to enable provisioning immediately for the farm(s).
|
||||
It's applicable only for 'AUTOMATED' farm type.
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: False
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Stop
|
||||
Switch to disable provisioning immediately for the farm(s).
|
||||
It's applicable only for 'AUTOMATED' farm type.
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: False
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Key
|
||||
Property names path separated by .
|
||||
(dot) from the root of desktop spec.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Value
|
||||
Property value corresponds to above key name.
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Spec
|
||||
Path of the JSON specification file containing key/value pair.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -HvServer
|
||||
Reference to Horizon View Server to query the data from.
|
||||
If the value is not passed or null then first element from global:DefaultHVServers would be considered in-place of hvServer.
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -WhatIf
|
||||
Shows what would happen if the cmdlet runs.
|
||||
The cmdlet is not run.
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases: wi
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Confirm
|
||||
Prompts you for confirmation before running the cmdlet.
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases: cf
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### None
|
||||
## NOTES
|
||||
| | |
|
||||
|-|-|
|
||||
| Author | praveen mathamsetty. |
|
||||
| Author email | pmathamsetty@vmware.com |
|
||||
| Version | 1.1 |
|
||||
|
||||
===Tested Against Environment====
|
||||
| | |
|
||||
|-|-|
|
||||
| Horizon View Server Version | 7.0.2, 7.1.0 |
|
||||
| PowerCLI Version | PowerCLI 6.5, PowerCLI 6.5.1 |
|
||||
| PowerShell Version | 5.0 |
|
||||
|
||||
## RELATED LINKS
|
||||
253
Modules/VMware.Hv.Helper/docs/Set-HVGlobalEntitlement.md
Executable file
253
Modules/VMware.Hv.Helper/docs/Set-HVGlobalEntitlement.md
Executable file
@@ -0,0 +1,253 @@
|
||||
---
|
||||
external help file: VMware.HV.Helper-help.xml
|
||||
Module Name: VMware.HV.Helper
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Set-HVGlobalEntitlement
|
||||
|
||||
## SYNOPSIS
|
||||
Sets the existing pool properties.
|
||||
|
||||
## SYNTAX
|
||||
|
||||
### option
|
||||
```
|
||||
Set-HVGlobalEntitlement -displayName <String> [-Key <String>] [-Value <Object>] [-Spec <String>] [-Enable]
|
||||
[-Disable] [-enableHTMLAccess <Boolean>] [-HvServer <Object>] [-WhatIf] [-Confirm] [<CommonParameters>]
|
||||
```
|
||||
|
||||
### pipeline
|
||||
```
|
||||
Set-HVGlobalEntitlement [-GlobalEntitlements <Object>] [-Key <String>] [-Value <Object>] [-Spec <String>]
|
||||
[-Enable] [-Disable] [-enableHTMLAccess <Boolean>] [-HvServer <Object>] [-WhatIf] [-Confirm]
|
||||
[<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
This cmdlet allows user to edit global entitlements.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### EXAMPLE 1
|
||||
```
|
||||
Set-HVGlobalEntitlement -DisplayName 'MyGlobalEntitlement' -Spec 'C:\Edit-HVPool\EditPool.json' -Confirm:$false
|
||||
```
|
||||
|
||||
Updates pool configuration by using json file
|
||||
|
||||
### EXAMPLE 2
|
||||
```
|
||||
Set-HVGlobalEntitlement -DisplayName 'MyGlobalEntitlement' -Key 'base.description' -Value 'update description'
|
||||
```
|
||||
|
||||
Updates pool configuration with given parameters key and value
|
||||
|
||||
### EXAMPLE 3
|
||||
```
|
||||
Set-HVGlobalEntitlement -DisplayName 'MyGlobalEntitlement' -enableHTMLAccess $true
|
||||
```
|
||||
|
||||
Set Allow HTML Access on a global entitlement.
|
||||
Note that it must also be enabled on the Pool and as of 7.3.0 Allow User to Choose Protocol must be enabled (which is unfortunately read-only)
|
||||
|
||||
### EXAMPLE 4
|
||||
```
|
||||
Get-HVGlobalEntitlement | Set-HVGlobalEntitlement -Disable
|
||||
```
|
||||
|
||||
Disable all global entitlements
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -displayName
|
||||
Display Name of Global Entitlement.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: option
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -GlobalEntitlements
|
||||
{{ Fill GlobalEntitlements Description }}
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: pipeline
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Key
|
||||
Property names path separated by .
|
||||
(dot) from the root of desktop spec.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Value
|
||||
Property value corresponds to above key name.
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Spec
|
||||
Path of the JSON specification file containing key/value pair.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Enable
|
||||
{{ Fill Enable Description }}
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: False
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Disable
|
||||
{{ Fill Disable Description }}
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: False
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -enableHTMLAccess
|
||||
If set to true, the desktops that are associated with this GlobalEntitlement must also have HTML Access enabled.
|
||||
|
||||
```yaml
|
||||
Type: Boolean
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: False
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -HvServer
|
||||
View API service object of Connect-HVServer cmdlet.
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -WhatIf
|
||||
Shows what would happen if the cmdlet runs.
|
||||
The cmdlet is not run.
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases: wi
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Confirm
|
||||
Prompts you for confirmation before running the cmdlet.
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases: cf
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### None
|
||||
## NOTES
|
||||
| | |
|
||||
|-|-|
|
||||
Author : Mark Elvers
|
||||
Author email : mark.elvers@tunbury.org
|
||||
Version : 1.0
|
||||
|
||||
===Tested Against Environment====
|
||||
| | |
|
||||
|-|-|
|
||||
Horizon View Server Version : 7.3.0, 7.3.1
|
||||
PowerCLI Version : PowerCLI 6.5.1
|
||||
PowerShell Version : 5.0
|
||||
|
||||
## RELATED LINKS
|
||||
520
Modules/VMware.Hv.Helper/docs/Set-HVGlobalSettings.md
Executable file
520
Modules/VMware.Hv.Helper/docs/Set-HVGlobalSettings.md
Executable file
@@ -0,0 +1,520 @@
|
||||
---
|
||||
external help file: VMware.HV.Helper-help.xml
|
||||
Module Name: VMware.HV.Helper
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Set-HVGlobalSettings
|
||||
|
||||
## SYNOPSIS
|
||||
Sets the Global Settings of the Connection Server Pod
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```
|
||||
Set-HVGlobalSettings [[-Key] <String>] [[-Value] <Object>] [[-Spec] <String>]
|
||||
[[-clientMaxSessionTimePolicy] <String>] [[-clientMaxSessionTimeMinutes] <Int32>]
|
||||
[[-clientIdleSessionTimeoutPolicy] <String>] [[-clientIdleSessionTimeoutMinutes] <Int32>]
|
||||
[[-clientSessionTimeoutMinutes] <Int32>] [[-desktopSSOTimeoutPolicy] <String>]
|
||||
[[-desktopSSOTimeoutMinutes] <Int32>] [[-applicationSSOTimeoutPolicy] <String>]
|
||||
[[-applicationSSOTimeoutMinutes] <Int32>] [[-viewAPISessionTimeoutMinutes] <Int32>]
|
||||
[[-preLoginMessage] <String>] [[-displayWarningBeforeForcedLogoff] <Boolean>]
|
||||
[[-forcedLogoffTimeoutMinutes] <Int32>] [[-forcedLogoffMessage] <String>]
|
||||
[[-enableServerInSingleUserMode] <Boolean>] [[-storeCALOnBroker] <Boolean>] [[-storeCALOnClient] <Boolean>]
|
||||
[[-reauthSecureTunnelAfterInterruption] <Boolean>] [[-messageSecurityMode] <String>]
|
||||
[[-enableIPSecForSecurityServerPairing] <Boolean>] [[-HvServer] <Object>] [-WhatIf] [-Confirm]
|
||||
[<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
This cmdlet allows user to set Global Settings by passing key/value pair or by passing specific parameters.
|
||||
Optionally, user can pass a JSON spec file.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### EXAMPLE 1
|
||||
```
|
||||
Set-HVGlobalSettings 'ManualPool' -Spec 'C:\Set-HVGlobalSettings\Set-GlobalSettings.json'
|
||||
```
|
||||
|
||||
### EXAMPLE 2
|
||||
```
|
||||
Set-HVGlobalSettings -Key 'generalData.clientMaxSessionTimePolicy' -Value 'NEVER'
|
||||
```
|
||||
|
||||
### EXAMPLE 3
|
||||
```
|
||||
Set-HVGlobalSettings -clientMaxSessionTimePolicy "TIMEOUT_AFTER" -clientMaxSessionTimeMinutes 1200
|
||||
```
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -Key
|
||||
Property names path separated by .
|
||||
(dot) from the root of global settings spec.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Value
|
||||
Property value corresponds to above key name.
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 2
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Spec
|
||||
Path of the JSON specification file containing key/value pair.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 3
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -clientMaxSessionTimePolicy
|
||||
Client max session lifetime policy.
|
||||
"TIMEOUT_AFTER" Indicates that the client session times out after a configurable session length (in minutes)
|
||||
"NEVER" Indicates no absolute client session length (sessions only end due to inactivity)
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 4
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -clientMaxSessionTimeMinutes
|
||||
Determines how long a user can keep a session open after logging in to View Connection Server.
|
||||
The value is set in minutes.
|
||||
When a session times out, the session is terminated and the View client is disconnected from the resource.
|
||||
Default value is 600.
|
||||
Minimum value is 5.
|
||||
Maximum value is 600.
|
||||
This property is required if clientMaxSessionTimePolicy is set to "TIMEOUT_AFTER"
|
||||
|
||||
```yaml
|
||||
Type: Int32
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 5
|
||||
Default value: 0
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -clientIdleSessionTimeoutPolicy
|
||||
Specifies the policy for the maximum time that a that a user can be idle before the broker takes measure to protect the session.
|
||||
"TIMEOUT_AFTER" Indicates that the user session can be idle for a configurable max time (in minutes) before the broker takes measure to protect the session.
|
||||
"NEVER" Indicates that the client session is never locked.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 6
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -clientIdleSessionTimeoutMinutes
|
||||
Determines how long a that a user can be idle before the broker takes measure to protect the session.
|
||||
The value is set in minutes.
|
||||
Default value is 15
|
||||
This property is required if -clientIdleSessionTimeoutPolicy is set to "TIMEOUT_AFTER"
|
||||
|
||||
```yaml
|
||||
Type: Int32
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 7
|
||||
Default value: 0
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -clientSessionTimeoutMinutes
|
||||
Determines the maximum length of time that a Broker session will be kept active if there is no traffic between a client and the Broker.
|
||||
The value is set in minutes.
|
||||
Default value is 1200
|
||||
Minimum value is 5
|
||||
|
||||
```yaml
|
||||
Type: Int32
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 8
|
||||
Default value: 0
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -desktopSSOTimeoutPolicy
|
||||
The single sign on setting for when a user connects to View Connection Server.
|
||||
"DISABLE_AFTER" SSO is disabled the specified number of minutes after a user connects to View Connection Server.
|
||||
"DISABLED" Single sign on is always disabled.
|
||||
"ALWAYS_ENABLED" Single sign on is always enabled.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 9
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -desktopSSOTimeoutMinutes
|
||||
SSO is disabled the specified number of minutes after a user connects to View Connection Server.
|
||||
Minimum value is 1
|
||||
Maximum value is 999
|
||||
|
||||
```yaml
|
||||
Type: Int32
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 10
|
||||
Default value: 0
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -applicationSSOTimeoutPolicy
|
||||
The single sign on timeout policy for application sessions.
|
||||
"DISABLE_AFTER" SSO is disabled the specified number of minutes after a user connects to View Connection Server.
|
||||
"DISABLED" Single sign on is always disabled.
|
||||
"ALWAYS_ENABLED" Single sign on is always enabled.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 11
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -applicationSSOTimeoutMinutes
|
||||
SSO is disabled the specified number of minutes after a user connects to View Connection Server.
|
||||
Minimum value is 1
|
||||
Maximum value is 999
|
||||
|
||||
```yaml
|
||||
Type: Int32
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 12
|
||||
Default value: 0
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -viewAPISessionTimeoutMinutes
|
||||
Determines how long (in minutes) an idle View API session continues before the session times out.
|
||||
Setting the View API session timeout to a high number of minutes increases the risk of unauthorized use of View API.
|
||||
Use caution when you allow an idle session to persist a long time.
|
||||
Default value is 10
|
||||
Minimum value is 1
|
||||
Maximum value is 4320
|
||||
|
||||
```yaml
|
||||
Type: Int32
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 13
|
||||
Default value: 0
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -preLoginMessage
|
||||
Displays a disclaimer or another message to View Client users when they log in.
|
||||
No message will be displayed if this is null.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 14
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -displayWarningBeforeForcedLogoff
|
||||
Displays a warning message when users are forced to log off because a scheduled or immediate update such as a machine-refresh operation is about to start.
|
||||
$TRUE or $FALSE
|
||||
|
||||
```yaml
|
||||
Type: Boolean
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 15
|
||||
Default value: False
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -forcedLogoffTimeoutMinutes
|
||||
{{ Fill forcedLogoffTimeoutMinutes Description }}
|
||||
|
||||
```yaml
|
||||
Type: Int32
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 16
|
||||
Default value: 0
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -forcedLogoffMessage
|
||||
The warning to be displayed before logging off the user.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 17
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -enableServerInSingleUserMode
|
||||
Permits certain RDSServer operating systems to be used for non-RDS Desktops.
|
||||
|
||||
```yaml
|
||||
Type: Boolean
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 18
|
||||
Default value: False
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -storeCALOnBroker
|
||||
Used for configuring whether or not to store the RDS Per Device CAL on Broker.
|
||||
$TRUE or $FALSE
|
||||
|
||||
```yaml
|
||||
Type: Boolean
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 19
|
||||
Default value: False
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -storeCALOnClient
|
||||
Used for configuring whether or not to store the RDS Per Device CAL on client devices.
|
||||
This value can be true only if the storeCALOnBroker is true.
|
||||
$TRUE or $FALSE
|
||||
|
||||
```yaml
|
||||
Type: Boolean
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 20
|
||||
Default value: False
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -reauthSecureTunnelAfterInterruption
|
||||
Reauthenticate secure tunnel connections after network interruption Determines if user credentials must be reauthenticated after a network interruption when View clients use secure tunnel connections to View resources.
|
||||
When you select this setting, if a secure tunnel connection ends during a session, View Client requires the user to reauthenticate before reconnecting.
|
||||
This setting offers increased security.
|
||||
For example, if a laptop is stolen and moved to a different network, the user cannot automatically gain access to the remote resource because the network connection was temporarily interrupted.
|
||||
When this setting is not selected, the client reconnects to the resource without requiring the user to reauthenticate.
|
||||
This setting has no effect when you use direct connection.
|
||||
|
||||
```yaml
|
||||
Type: Boolean
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 21
|
||||
Default value: False
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -messageSecurityMode
|
||||
Determines if signing and verification of the JMS messages passed between View Manager components takes place.
|
||||
"DISABLED" Message security mode is disabled.
|
||||
"MIXED" Message security mode is enabled but not enforced.
|
||||
You can use this mode to detect components in your View environment that predate View Manager 3.0.
|
||||
The log files generated by View Connection Server contain references to these components.
|
||||
"ENABLED" Message security mode is enabled.
|
||||
Unsigned messages are rejected by View components.
|
||||
Message security mode is enabled by default.
|
||||
Note: View components that predate View Manager 3.0 are not allowed to communicate with other View components.
|
||||
"ENHANCED" Message Security mode is Enhanced.
|
||||
Message signing and validation is performed based on the current Security Level and desktop Message Security mode.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 22
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -enableIPSecForSecurityServerPairing
|
||||
Determines whether to use Internet Protocol Security (IPSec) for connections between security servers and View Connection Server instances.
|
||||
By default, secure connections (using IPSec) for security server connections is enabled.
|
||||
$TRUE or $FALSE
|
||||
|
||||
```yaml
|
||||
Type: Boolean
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 23
|
||||
Default value: False
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -HvServer
|
||||
View API service object of Connect-HVServer cmdlet.
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 24
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -WhatIf
|
||||
Shows what would happen if the cmdlet runs.
|
||||
The cmdlet is not run.
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases: wi
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Confirm
|
||||
Prompts you for confirmation before running the cmdlet.
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases: cf
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### None
|
||||
## NOTES
|
||||
| | |
|
||||
|-|-|
|
||||
| Author | Matt Frey. |
|
||||
| Author email | mfrey@vmware.com |
|
||||
| Version | 1.0 |
|
||||
|
||||
===Tested Against Environment====
|
||||
| | |
|
||||
|-|-|
|
||||
| Horizon View Server Version | 7.1 |
|
||||
| PowerCLI Version | PowerCLI 6.5.1 |
|
||||
| PowerShell Version | 5.0 |
|
||||
|
||||
## RELATED LINKS
|
||||
147
Modules/VMware.Hv.Helper/docs/Set-HVInstantCloneMaintenance.md
Executable file
147
Modules/VMware.Hv.Helper/docs/Set-HVInstantCloneMaintenance.md
Executable file
@@ -0,0 +1,147 @@
|
||||
---
|
||||
external help file: VMware.HV.Helper-help.xml
|
||||
Module Name: VMware.HV.Helper
|
||||
online version:
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Set-HVInstantCloneMaintenance
|
||||
|
||||
## SYNOPSIS
|
||||
Enable or disable instant clone maintanence mode
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```
|
||||
Set-HVInstantCloneMaintenance [-VMHost] <String> [-Enable] [-Disable] [-HvServer <Object>] [-WhatIf] [-Confirm]
|
||||
[<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
Toggles a host in instant clone maintanence mode.
|
||||
Specify the VMHost name and enable or disable to toggle.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### EXAMPLE 1
|
||||
```
|
||||
-Enable $true
|
||||
```
|
||||
|
||||
Set-HvInstantCloneMaintenance -VMHost \<hostname\> -Disable $true
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -VMHost
|
||||
ESXi Host name to modify the InstantClone.Maintenance attribute
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Enable
|
||||
Enable Instant Clone maintenance mode.
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: False
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Disable
|
||||
Disable Instant Clone maintenance mode
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: False
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -HvServer
|
||||
{{ Fill HvServer Description }}
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -WhatIf
|
||||
Shows what would happen if the cmdlet runs.
|
||||
The cmdlet is not run.
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases: wi
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Confirm
|
||||
Prompts you for confirmation before running the cmdlet.
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases: cf
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
## NOTES
|
||||
| | |
|
||||
|-|-|
|
||||
| Author | Jack McMichael |
|
||||
| Author email | @jackwmc4 / jackwmc4@gmail.com |
|
||||
| Version | 1.0 |
|
||||
|
||||
===Tested Against Environment====
|
||||
| | |
|
||||
|-|-|
|
||||
| Horizon View Server Version | 7.6 |
|
||||
| PowerCLI Version | PowerCLI 11 |
|
||||
| PowerShell Version | 5.1 |
|
||||
|
||||
## RELATED LINKS
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user