Closed Crypto-Gi closed 6 years ago
it will check but you need to use get "member" before
$TEST-1234 = Get-NsxService
and after
Get-NsxServiceGroup Test-Group-2 | Add-nsxServiceGroupMember -Member $TEST-1234
☹ not working
PS C:\Users> Get-NsxServiceGroup TEST-GROUP-2
objectId : applicationgroup-9a5c270c-6230-4ea1-a02f-2e05c1e152ab objectTypeName : ApplicationGroup vsmUuid : 564DE042-0851-C5AB-19E8-C86063B3644B nodeId : 26fb786f-6d42-43f3-83b2-062fd0891aa3 revision : 1 type : type name : TEST-GROUP-2 description : TEST GROUP scope : scope clientHandle : extendedAttributes : isUniversal : true universalRevision : 0 inheritanceAllowed : false
PS C:\Usersr> Get-NsxService TEST1234
objectId : application-823e409a-5bb5-4d72-bae1-cfb21306c107 objectTypeName : Application vsmUuid : 564DE042-0851-C5AB-19E8-C86063B3644B nodeId : 26fb786f-6d42-43f3-83b2-062fd0891aa3 revision : 2 type : type name : TEST1234 description : TEST SERVICE scope : scope clientHandle : extendedAttributes : isUniversal : true universalRevision : 1 inheritanceAllowed : false element : element
PS C:\Users\r> Get-NsxServiceGroup TEST-GROUP-2 | Add-NsxServiceGroupMember -Member $TEST1234 invoke-nsxwebrequest : Invoke-NsxWebRequest : The NSX API response received indicates a failure. 400 : Bad Request : Response Body: <?xml version="1.0" encoding="UTF-8"?>
At C:\Users\CSLTMir\Documents\WindowsPowerShell\Modules\PowerNSX\PowerNSX.psm1:26662 char:21
+ CategoryInfo : InvalidResult: (Invoke-NsxWebRequest:String) [Invoke-NsxWebRequest], InternalNsxApiExcep
tion
+ FullyQualifiedErrorId : NsxAPIFailureResult,Invoke-NsxWebRequest
invoke-nsxwebrequest : Invoke-NsxWebRequest : The NSX API response received indicates a failure. 400 : Bad Request : Response Body: <?xml version="1.0" encoding="UTF-8"?>
At C:\Users\CSLTMir\Documents\WindowsPowerShell\Modules\PowerNSX\PowerNSX.psm1:26662 char:21
+ CategoryInfo : InvalidResult: (Invoke-NsxWebRequest:String) [Invoke-NsxWebRequest], InternalNsxApiExcep
tion
+ FullyQualifiedErrorId : NsxAPIFailureResult,Invoke-NsxWebRequest
invoke-nsxwebrequest : Invoke-NsxWebRequest : The NSX API response received indicates a failure. 400 : Bad Request : Response Body: <?xml version="1.0" encoding="UTF-8"?>
At C:\Users\CSLTMir\Documents\WindowsPowerShell\Modules\PowerNSX\PowerNSX.psm1:26662 char:21
+ CategoryInfo : InvalidResult: (Invoke-NsxWebRequest:String) [Invoke-NsxWebRequest], InternalNsxApiExcep
tion
+ FullyQualifiedErrorId : NsxAPIFailureResult,Invoke-NsxWebRequest
see #533 - you should not use variable names that contain dashes. . Also - from your screenshot before, it looks as if you are trying to add a local service to a universal servicegroup which (as the error says) isnt supported.
How can I add multiple variables
$service = get-nsxservice test-1234 , test-3 , test4 or $service = get-nsxservice test-1234 test-3 test4
Plz let me know how we could add service or servicegroup to service group . I've tried different combinations of cmdlts but it does not works.
Get-NsxServiceGroup TEST-GROUP-2 | Add-NsxServiceGroupMember -Member "TEST-1234" Get-NsxServiceGroup TEST-GROUP-2 | Add-NsxServiceGroupMember -Member $TEST-1234 Get-NsxServiceGroup TEST-GROUP-2 | Add-NsxServiceGroupMember -Member TEST-1234