首页 > 解决方案 > 使用 Azure RUN 命令的 Get-Service 命令脚本响应未显示 Azure 虚拟机的所有列值

问题描述

我需要 azure 虚拟机中存在的服务。

在 Azure 门户中使用 RUN 命令,我执行了以下 power shell 脚本。

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

输出(样本)是:

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

现在,为了获得响应的服务启动类型,将输入命令修改为:

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

脚本响应是:

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

脚本响应不正确

  1. 它不包含起始类型列值
  2. 列的顺序不正确

这个问题来自 Azure 方面吗?我错过了一些细节吗?有什么建议么。

标签: azureazure-virtual-machine

解决方案


您应该运行此命令。

(获取服务)| 选择-对象名称、状态、显示名称、开始类型
PS C:\Users\taguada>(获取服务)| 选择-对象名称、状态、显示名称、开始类型

名称 状态 DisplayName StartType
---- ------ ------------ ---------
AarSvc_2aa0c 停止 AarSvc_2aa0c 手册
AJRouter 停止 AllJoyn 路由器服务手册
ALG 停止应用层网关服务手册
AppIDSvc 已停止应用程序身份手册
Appinfo 运行应用信息手册
AppleOSSMgr 自动运行 Apple OS 切换管理器
AppMgmt 已停止应用程序管理手册
AppReadiness Stopped App Readiness Manual
AppVClient 已停止 Microsoft App-V 客户端已禁用

推荐阅读