Missing Containers Cmdlet - powershell

I created the new Server Core (Windows 2016). I can't find the all container cmdlet in powershell. I did Uninstall/installed the containers feature but still missing all cmdlet. How do i get containers cmdlet in powershell?
Here is my server info.
WindowsBuildLabEx : 16299.15.amd64fre.rs3_release.170928-1534
WindowsCurrentVersion : 6.3
WindowsEditionId : ServerDatacenterACor
WindowsInstallationType : Server Core
WindowsInstallDateFromRegistry : 28/4/2018 12:41:19 PM
WindowsProductId : 00395-60000-00001-AA842
WindowsProductName : Windows Server Datacenter
WindowsRegisteredOrganization :
WindowsRegisteredOwner : Windows User
WindowsSystemRoot : C:\Windows
WindowsVersion : 1709
BiosCharacteristics : {3, 9, 15, 16...}
BiosBIOSVersion : {VRTUAL - 1, Hyper-V UEFI Release v2.5, Microsoft - 100032}
BiosBuildNumber :
BiosCaption : Hyper-V UEFI Release v2.5
BiosCodeSet :
BiosCurrentLanguage :
BiosDescription : Hyper-V UEFI Release v2.5
BiosEmbeddedControllerMajorVersion : 255
BiosEmbeddedControllerMinorVersion : 255
BiosFirmwareType : Uefi
BiosIdentificationCode :
BiosInstallableLanguages :
BiosInstallDate :
BiosLanguageEdition :
BiosListOfLanguages :
BiosManufacturer : Microsoft Corporation
BiosName : Hyper-V UEFI Release v2.5
BiosOtherTargetOS :
BiosPrimaryBIOS : True
BiosReleaseDate : 22/8/2017 8:00:00 AM
BiosSeralNumber : 8355-6248-8581-2148-3845-5374-58
BiosSMBIOSBIOSVersion : Hyper-V UEFI Release v2.5
BiosSMBIOSMajorVersion : 2
BiosSMBIOSMinorVersion : 4
BiosSMBIOSPresent : True
BiosSoftwareElementState : Running
BiosStatus : OK
BiosSystemBiosMajorVersion : 2
BiosSystemBiosMinorVersion : 5
BiosTargetOperatingSystem : 0
BiosVersion : VRTUAL - 1
CsAdminPasswordStatus : Unknown
CsAutomaticManagedPagefile : True
CsAutomaticResetBootOption : True
CsAutomaticResetCapability : True
CsBootOptionOnLimit :
CsBootOptionOnWatchDog :
CsBootROMSupported : True
CsBootStatus : {0, 0, 0, 127...}
CsBootupState : Normal boot
CsCaption : WIN16DCORE
CsChassisBootupState : Safe
CsChassisSKUNumber :
CsCurrentTimeZone : 480
CsDaylightInEffect :
CsDescription : AT/AT COMPATIBLE
CsDNSHostName : WIN16DCore
CsDomain : WORKGROUP
CsDomainRole : StandaloneServer
CsEnableDaylightSavingsTime : True
CsFrontPanelResetStatus : Unknown
CsHypervisorPresent : True
CsInfraredSupported : False
CsInitialLoadInfo :
CsInstallDate :
CsKeyboardPasswordStatus : Unknown
CsLastLoadInfo :
CsManufacturer : Microsoft Corporation
CsModel : Virtual Machine
CsName : WIN16DCORE
CsNetworkAdapters : {vEthernet - 1}
CsNetworkServerModeEnabled : True
CsNumberOfLogicalProcessors : 1
CsNumberOfProcessors : 1
CsProcessors : {Intel(R) Core(TM) i3-2100 CPU # 3.10GHz}
CsOEMStringArray : {[MS_VM_CERT/SHA1/9b80ca0d5dd061ec9da4e494f4c3fd1196270c22],
00000000000000000000000000000000, To be filled by OEM}
CsPartOfDomain : False
CsPauseAfterReset : -1
CsPCSystemType : Desktop
CsPCSystemTypeEx : Desktop
CsPowerManagementCapabilities :
CsPowerManagementSupported :
CsPowerOnPasswordStatus : Unknown
CsPowerState : Unknown
CsPowerSupplyState : Safe
CsPrimaryOwnerContact :
CsPrimaryOwnerName : Windows User
CsResetCapability : Other
CsResetCount : -1
CsResetLimit : -1
CsRoles : {LM_Workstation, LM_Server, NT, Server_NT}
CsStatus : OK
CsSupportContactDescription :
CsSystemFamily : Virtual Machine
CsSystemSKUNumber : None
CsSystemType : x64-based PC
CsThermalState : Safe
CsTotalPhysicalMemory : 5082476544
CsPhyicallyInstalledMemory : 4964352
CsUserName :
CsWakeUpType : PowerSwitch
CsWorkgroup : WORKGROUP
OsName : Microsoft Windows Server Datacenter
OsType : WINNT
OsOperatingSystemSKU : 145
OsVersion : 10.0.16299
OsCSDVersion :
OsBuildNumber : 16299
OsHotFixes : {KB4099989, KB4093112}
OsBootDevice : \Device\HarddiskVolume2
OsSystemDevice : \Device\HarddiskVolume4
OsSystemDirectory : C:\Windows\system32
OsSystemDrive : C:
OsWindowsDirectory : C:\Windows
OsCountryCode : 65
OsCurrentTimeZone : 480
OsLocaleID : 4809
OsLocale : en-SG
OsLocalDateTime : 29/4/2018 1:35:42 PM
OsLastBootUpTime : 29/4/2018 1:23:23 PM
OsUptime : 00:12:18.3221697
OsBuildType : Multiprocessor Free
OsCodeSet : 1252
OsDataExecutionPreventionAvailable : True
OsDataExecutionPrevention32BitApplications : True
OsDataExecutionPreventionDrivers : True
OsDataExecutionPreventionSupportPolicy : OptOut
OsDebug : False
OsDistributed : False
OsEncryptionLevel : 256
OsForegroundApplicationBoost : Maximum
OsTotalVisibleMemorySize : 4963356
OsFreePhysicalMemory : 4239756
OsTotalVirtualMemorySize : 6536220
OsFreeVirtualMemory : 5858416
OsInUseVirtualMemory : 677804
OsTotalSwapSpaceSize :
OsSizeStoredInPagingFiles : 1572864
OsFreeSpaceInPagingFiles : 1572864
OsPagingFiles : {C:\pagefile.sys}
OsHardwareAbstractionLayer : 10.0.16299.371
OsInstallDate : 28/4/2018 8:41:19 PM
OsManufacturer : Microsoft Corporation
OsMaxNumberOfProcesses : 4294967295
OsMaxProcessMemorySize : 137438953344
OsMuiLanguages : {en-US}
OsNumberOfLicensedUsers : 0
OsNumberOfProcesses : 66
OsNumberOfUsers : 2
OsOrganization :
OsArchitecture : 64-bit
OsLanguage : en-US
OsProductSuites : {TerminalServices, TerminalServicesSingleSession}
OsOtherTypeDescription :
OsPAEEnabled :
OsPortableOperatingSystem : False
OsPrimary : True
OsProductType : Server
OsRegisteredUser : Windows User
OsSerialNumber : 00395-60000-00001-AA842
OsServicePackMajorVersion : 0
OsServicePackMinorVersion : 0
OsStatus : OK
OsSuites : {TerminalServices, TerminalServicesSingleSession}
OsServerLevel : ServerCore
KeyboardLayout : en-US
TimeZone : (UTC+08:00) Kuala Lumpur, Singapore
LogonServer :
PowerPlatformRole : Desktop
HyperVisorPresent : True
HyperVRequirementDataExecutionPreventionAvailable :
HyperVRequirementSecondLevelAddressTranslation :
HyperVRequirementVirtualizationFirmwareEnabled :
HyperVRequirementVMMonitorModeExtensions :
DeviceGuardSmartStatus : Off
DeviceGuardRequiredSecurityProperties :
DeviceGuardAvailableSecurityProperties :
DeviceGuardSecurityServicesConfigured :
DeviceGuardSecurityServicesRunning :
DeviceGuardCodeIntegrityPolicyEnforcementStatus :
DeviceGuardUserModeCodeIntegrityPolicyEnforcementStatus :
Here is cmdlet to find the container cmdlet and result
Get-WindowsFeature -Name Containers
Display Name Name Install State
------------ ---- -------------
[X] Containers Containers Installed
Get-InstalledModule
Version Name Repository Description
------- ---- ---------- -----------
1.0.0.4 DockerMsftProvider PSGallery PowerShell module with commands for discovering,...
1.0.154 DockerPowershell PSGallery Adds cmdlets to work with the Docker cli.
get-command | where Source -EQ "*cont*"
Empty

Related

Is there a way to get the server ID of the registered server in an Azure storage sync service through power shell or ARM template?

{
"name": "string",
"type": "Microsoft.StorageSync/storageSyncServices/syncGroups/serverEndpoints",
"apiVersion": "2019-06-01",
"properties": {
"serverLocalPath": "string",
"cloudTiering": "string",
"volumeFreeSpacePercent": "integer",
"tierFilesOlderThanDays": "integer",
"friendlyName": "string",
"serverResourceId": "string",
"offlineDataTransfer": "string",
"offlineDataTransferShareName": "string"
}
}
What needs to be passed as a server resource id in the above template format for storage sync. How do we get the server id ?
Yes. Use the Get-AzStorageSyncServerEndpoint cmdlet from the Az.StorageSync module to list all server endpoints within a given sync group.
Get-AzStorageSyncServerEndpoint -ResourceGroupName "myResourceGroup" -StorageSyncServiceName "mysyncservice" -SyncGroupName "testsyncgroup"
Sample Response:
SyncGroupName : testsyncgroup
StorageSyncServiceName : mysyncservice
ServerLocalPath : C:\Users\onpremwindows\Desktop\myfolder
ServerResourceId : /subscriptions/***/resourceGroups/myResourceGroup/providers/microsoft.stor
agesync/storageSyncServices/mysyncservice/registeredServers/8ec8b78c-0739-195r-856e-2e7r5ta2c13w
ServerEndpointName : 94e9fd59-23d6-9854-99c1-3e9a8ab73760
ProvisioningState : Succeeded
LastWorkflowId : storageSyncServices/mysyncservice/workflows/bd3o8c77-7183-4a46-8830-9b156dd2f011
LastOperationName : ICreateServerEndpointWorkflow
FriendlyName : onpremwindows
SyncStatus : Microsoft.Azure.Commands.StorageSync.Models.PSServerEndpointHealth
CloudTiering : Off
VolumeFreeSpacePercent : 20
TierFilesOlderThanDays :
OfflineDataTransfer : Off
OfflineDataTransferShareName :
OfflineDataTransferStorageAccountResourceId :
OfflineDataTransferStorageAccountTenantId :
InitialDownloadPolicy : NamespaceThenModifiedFiles
LocalCacheMode : UpdateLocallyCachedFiles
ResourceId : /subscriptions/***/resourceGroups/myResourceGroup/providers/microsoft.stor
agesync/storageSyncServices/mysyncservice/syncGroups/testsyncgroup/serverEndpoints/94e9fd59-23d6-9854-99c1-3e9a8ab73760
ResourceGroupName : myResourceGroup
Type : microsoft.storagesync/storageSyncServices/syncGroups/serverEndpoints
8ec8b78c-0739-195r-856e-2e7r5ta2c13w would be the ServerId you can pass.
You can obtain the ServerId using the Get-AzStorageSyncService cmdlet as well:
Get-AzStorageSyncService -ResourceGroupName "myResourceGroup" -StorageSyncServiceName "mysyncservice"
Sample response:
StorageSyncServiceName : mysyncservice
ServerName : 8ec8b78c-0739-195r-856e-2e7r5ta2c13w
ServerCertificate :
AgentVersion : 8.0.0.0
ServerOSVersion : 10.0.14393.0
ServerManagementErrorCode : 0
LastHeartBeat : 12/10/2019 12:55:01
ProvisioningState : Succeeded
ServerRole : Standalone
ClusterId : 00000000-0000-0000-0000-000000000000
ClusterName :
ServerId : 8ec8b78c-0739-195r-856e-2e7r5ta2c13w
StorageSyncServiceUid : 76104503-6cd8-4812-7884-c4288e87a8cd
LastWorkflowId : storageSyncServices/finalsync/workflows/0e3bc737-7619-4b42-81a9-aec36e3fbf53
LastOperationName : ICreateRegisteredServerWorkflow
DiscoveryEndpointUri : https://tm-server.xxx.com:443
ResourceLocation : eastasia
ServiceLocation : eastasia
FriendlyName : onpremwindows
ManagementEndpointUri : https://tm-server.xxx.com:443
MonitoringEndpointUri : https://tm-server.xxx.com:443
ResourceId : /subscriptions/***/resourceGroups/myResourceGroup/providers/microsoft.storagesync/storageSyncServices/mysyncservice/registeredServers/8ec8b78c-0739-195r-856e-2e7r5ta2c13w
ResourceGroupName : myResourceGroup
Type : microsoft.storagesync/storageSyncServices/registeredServers

Gatling Time Extraction From Response Body

I am completely new to Gatling/Scala.
I have a scenario to execute. Here it goes:
-->Change the shift timings of the employees.
For the above, I am able to script/code the flow. However, I have a challenge:
-> I need to extract the "new" time values from the response and check if that matches with the "new" time values being passed through the parameter (csv) file.
Approach/logic: Extract the date values from the response body and compare that with the date value that has been provided in the csv file.
Sample Response:
{
"employeeId":"xxxxxx",
"schedules":
[
{
"date":"2019-11-25",
: : : "schedules":
: : : [
: : : : {
: : : : : "employeeId":"xxxxxx",
: : : : : "laborWeekStartDate":"2019-11-25", //New edited time
: : : : : "laborWeekEndDate":"2019-12-01", //New edited time
: : : : : "schedules":
: : : : : {
: : : : : : "startTime":"2019-11-25T18:15:00.000Z",
: : : : : : "endTime":"2019-11-25T23:45:00.000Z",
: : : : : : "departmentId":xxxxx,
: : : : : : "departmentName":"abc",
: : : : : : "lastModifiedTimestamp":"2019-12-11T09:22:44.000Z",
: : : : : : "breakDetails":
: : : : : : [
: : : : : : : {
: : : : : : : : "startTime":"2019-11-25T21:00:00.000Z",
: : : : : : : : "endTime":"2019-11-25T21:15:00.000Z",
: : : : : : : : "type":"break"
: : : : : : : }
: : : : : : ]
: : : : : }
: : : : }
: : : ]
: : }
Here, in the below, the right-handside values need to be extracted and compared with the values provided in the csv file.
"startTime":"2019-11-25T18:15:00.000Z",
"endTime":"2019-11-25T23:45:00.000Z",
Please help in performing the above. A step-wise detailed explanation would be much appreciated considering I am totally new to this.
Thanks!
Disclaimer: I will provide some useful links that should help you in achieving the task. If you will encounter any problems doing it, just post a new question
In order to get a value from a JSON response, you could use a jsonPath HTTP response body. There is an example here, how value can be extracted and saved using this method :JSON Path Usage for Gatling Tests
Reading values from CSV file is possible using a built-in feeder functionality: CSV feeders .Once you have the feeder added, you can reference a value using ${columnName} There is an example here: Step 03: Use dynamic data with Feeders and Checks.
After this step you have both values in session. Then using scala language, you should be able to compare those values. Getting a value from session happens using session("variableName").as[String]
For example, you could do a String comparision, if you first substring the value from csv. Scala String comparision Another option is like described here, which is really close to your requirement : How to compare responses from http calls in gatling?
Good luck! :)

Could not to inspect the dedicated host provisioning process

When I used slcli(softlayer-python command) to create a dedicated host, the command return the order id. And I check the order's status was 'APPROVED'. But I can not get the host in the result of 'SoftLayer_Account/getDedicatedHosts'.
So I check the billing item and it is 'dedicated_virtual_hosts' rightly. Did SoftLayer API support another approach to inspect the dedicated host provisioned? Or did I do something wrong?
Yes, the dedicated host should be listed when calling to SoftLayer_Account::getDedicatedHosts method, or when using the "slcli dedicatedhost list" command. I suggest to check your permissions and device access, verify that "View Virtual Dedicated Host Details" is checked.
Below are some slcli commands I executed to order and list dedicated hosts.
To order a dedicated host:
slcli dedicatedhost create -H slahostname -D example.com -d mex01 -f 56_CORES_X_242_RAM_X_1_4_TB
To list dedicated hosts:
slcli dedicatedhost list
:.......:...................:..........:..............:................:............:............:
: id : name : cpuCount : diskCapacity : memoryCapacity : datacenter : guestCount :
:.......:...................:..........:..............:................:............:............:
: 11111 : slahostname : 56 : 1200 : 242 : mex01 : - :
:.......:...................:..........:..............:................:............:............:
Below an example about how to see the details:
slcli dedicatedhost detail 11111
:.................:...........................:
: name : value :
:.................:...........................:
: id : 11111 :
: name : slahostname :
: cpu count : 56 :
: memory capacity : 242 :
: disk capacity : 1200 :
: create date : 2018-02-01T09:53:46-04:00 :
: modify date : :
: router id : 333333 :
: router hostname : bcr01a.mex01 :
: owner : owner001 :
: guest count : 0 :
: datacenter : mex01 :
:.................:...........................:
Using RestFul the response when calling to SoftLayer_Account::getDedicatedHosts should be something like below:
GET:
https://[userName]:[apiKey]#api.softlayer.com/rest/v3/SoftLayer_Account/getDedicatedHosts
RESPONSE:
{
"cpuCount": 56,
"createDate": "2018-02-01T09:53:46-04:00",
"diskCapacity": 1200,
"id": 11111,
"memoryCapacity": 242,
"modifyDate": null,
"name": "slahostname"
}
Also you can use SoftLayer_Virtual_DedicatedHost::getObject method:
GET:
https://[userName]:[apiKey]#api.softlayer.com/rest/v3/SoftLayer_Virtual_DedicatedHost/11111/getObject

How to loop and insert data into different tables from JSON

I have a JSON and I need to write the values into different tables. I could get the data from json, but I need to insert the data accordingly. It's like I have a form, the form has n number of sections, each section have n number of steps and each step can have n number of questions. How I can loop this and write into different tables? Basically I need to know how we can find how many sections, steps and questions we have in the JSON. I tried array_length, but not working.
Here is a small sample of my JSON.
{ "functionId" : "2","subFunctionId" : "6","groupId" : "11","formId" : "","formName":"BladeInseption","submittedBy" : "200021669","createdDate" : "2015-08-06",
"updatedBy" : "","updatedDate" : "","comments" : "","formStatusId" :"11","formStatus" :"Draft","formLanguage" : "English","isFormConfigured" : "N","formChange":"Yes",
"sectionLevelChange":"Yes","isActive" : "Y","formVersionNo" : "1.0","formFooterDetails" : "","formHeaderDetails" : "","images" : [
{"imageId" : "","imageTempId" : "","imageTempUrl" : "","imageName" : "","imageUrl" : "","isDeleted" : "","imagesDesc" : ""} ],
"imagesDescLevel" : "","sectionElements" : [{"sectionElement":[{"sectionId" : "","sectionTempId":"sectionId+DDMMHHSSSS","sectionName":"section1",
"sectionChange":"Yes","stepLevelChange":"Yes","sectionLabel" : "","sectionOrder" : "1","outOfScopeSection" : "false",
"punchListSection" : "false","images" : [{"imageId" : "","imageTempId" : "","imageTempUrl" : "","imageName" : "","imageUrl" : "","isDeleted" : "",
"imagesDesc" : ""}],"imagesDescLevel" : "","isDeleted" : "","stepElements" : [{"stepElement":[{"stepId" : "","stepTempId":"stepId+DDMMHHSSSS",
"stepName":"section1step1","stepLabel" : "","stepOrder" : "1","stepChange":"Yes","questionLevelChange":"Yes","images" : [{"imageId" : "",
"imageTempId" : "","imageTempUrl" : "","imageName" : "","imageUrl" : "","isDeleted" : "","imagesDesc" : ""}],"imagesDescLevel" : "","isDeleted" : "",
"questionAnswerElements" : [{"questionAnswerElement":[{"questionId" : "","questionClientUid" : "","questionDescription" : "step1question1",
"questionAccessibility" : "","isPunchListQuestion" : "","questionChange":"Yes","questionOrder" : "1","isDeleted" : "","images" : [{
"imageId" : "","imageTempId" : "","imageTempUrl" : "","imageName" : "","imageUrl" : "","isDeleted" : "","imagesDesc" : ""}],"imagesDescLevel" : "",
"answerId" : "","answerClientUid" : "","elements" :[{"element" :[{"elementId": "2","elementMapId" : "12","clientUid" : "","clientClass" : "","imageTempId" : "",
"imageTempUrl" : "","elementType":"Question","elementOrder" : "1","elementArributuesProp": [{"attributeId" : "1","attributeName" : "","defaultValue" : ""}],
"elementArributuesVal":[{"value1" : "item1"}],"rule" : [{"ruleId" : "1","ruleName" : "Mandatory","formula" : "i>a","formulaData" : "i>50","isDeleted" : "",
...
}
If you know all paths to JSON arrays in your code, can use some special functions appearing in 9.4 such as
SELECT json_array_length('{"array":[{"a":1},{"b":2},{"c":3}]}'::json->'array')
If you need to iterate through JSON array, there is another useful function:
SELECT json_array_elements('{"array":[{"a":1},{"b":2},{"c":3}]}'::json->'array')
SELECT json_array_elements('[{"a":1},{"b":2},{"c":3}]'::json)
or if json is stored in table, lets call
SELECT json_array_elements(tbl.json_value->'array') FROM jsontable AS tbl
It returns a set of json values unwrapped from array ready to processing.
http://www.postgresql.org/docs/9.4/static/functions-json.html
More information about JSON parsing can be found here
How do I query using fields inside the new PostgreSQL JSON datatype?

Getting USB Version through WMI Classes

I am trying to query the USB Device for the USB Descriptor which will store information regarding the USB Version, Device ID, PID, VID etc. I only need the USB Version.
Here is the PowerShell Code so far:
[System.Reflection.Assembly]::Load("System.Management, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
$Man = New-Object System.Management.ManagementClass("Win32_USBHub")
[System.Management.ManagementObjectCollection]$Devs = $Man.GetInstances()
echo $Devs
The output I am getting is:
__GENUS : 2
__CLASS : Win32_USBHub
__SUPERCLASS : CIM_USBHub
__DYNASTY : CIM_ManagedSystemElement
__RELPATH : Win32_USBHub.DeviceID="USB\\VID_0781&PID_5567\\4C530000120619102080"
__PROPERTY_COUNT : 28
__DERIVATION : {CIM_USBHub, CIM_USBDevice, CIM_LogicalDevice, CIM_LogicalElement...}
__SERVER : APPS-SD-AUTO-PC
__NAMESPACE : root\cimv2
__PATH : \\APPS-SD-AUTO- PC\root\cimv2:Win32_USBHub.DeviceID="USB\\VID_0781&PID_5567\\4C530000120619102080"
Availability :
Caption : USB Mass Storage Device
ClassCode :
ConfigManagerErrorCode : 0
ConfigManagerUserConfig : False
CreationClassName : Win32_USBHub
CurrentAlternateSettings :
CurrentConfigValue :
Description : USB Mass Storage Device
DeviceID : USB\VID_0781&PID_5567\4C530000120619102080
ErrorCleared :
ErrorDescription :
GangSwitched :
InstallDate :
LastErrorCode :
Name : USB Mass Storage Device
NumberOfConfigs :
NumberOfPorts :
PNPDeviceID : USB\VID_0781&PID_5567\4C530000120619102080
PowerManagementCapabilities :
PowerManagementSupported :
ProtocolCode :
Status : OK
StatusInfo :
SubclassCode :
SystemCreationClassName : Win32_ComputerSystem
SystemName : APPS-SD-AUTO-PC
USBVersion :
Here USBVersion is coming as an empty field. Can anyone suggest a solution?
I have tried with Win32_usbDeviceController but that is also returning an empty field.