karthik_varma_k
karthik_varma_k

Reputation: 503

Get-Service command script response using Azure RUN command is not showing all column values for Azure Virtual Machines

I need services that are present in azure virtual machine.

Using RUN command in Azure portal, I have executed the below power shell script.

Get-Service | select -property name,status,displayname

Output(sample) is :

vmicrdv                                  Running Hyper-V Remote Desktop Virtualization Service                         
vmicshutdown                             Running Hyper-V Guest Shutdown Service                                        
vmictimesync                             Running Hyper-V Time Synchronization Service 

Now, In order to get service start type in response, modified the input command to :

Get-Service | select -property name,status,displayname,starttype

And the script response is :

 Running vmicrdv                                  Hyper-V Remote Desktop Virtualization Service                    
 Running vmicshutdown                             Hyper-V Guest Shutdown Service                                   
 Running vmictimesync                             Hyper-V Time Synchronization Service    

Script response is incorrect.

  1. It does not contains start type column value
  2. Order of columns is incorrect

Is this issue from Azure side? Am i missing some details? Any suggestions.

Upvotes: 0

Views: 171

Answers (1)

Taguada
Taguada

Reputation: 476

You should run this command.

(Get-Service) | Select-Object name,status,displayname,starttype
PS C:\Users\taguada> (Get-Service) | Select-Object name,status,displayname,starttype

Name                                                    Status DisplayName                                                                        StartType
----                                                    ------ -----------                                                                        ---------
AarSvc_2aa0c                                           Stopped AarSvc_2aa0c                                                                          Manual
AJRouter                                               Stopped AllJoyn Router Service                                                                Manual
ALG                                                    Stopped Application Layer Gateway Service                                                     Manual
AppIDSvc                                               Stopped Application Identity                                                                  Manual
Appinfo                                                Running Application Information                                                               Manual
AppleOSSMgr                                            Running Apple OS Switch Manager                                                            Automatic
AppMgmt                                                Stopped Application Management                                                                Manual
AppReadiness                                           Stopped App Readiness                                                                         Manual
AppVClient                                             Stopped Microsoft App-V Client                                                              Disabled

Upvotes: 0

Related Questions