繁体   English   中英

如何在 powershell 脚本中获取命令 output?

[英]How to get command output in the powershell script?

我想编写一个小脚本,向我展示 microsoft 团队软件中的所有团队。

Write-host "XXX"
Start-Sleep -Seconds 3
Connect-MicrosoftTeams;
Write-host "XXX"
Get-Team

但是在脚本运行“get-team”命令后,它没有显示该命令的结果。 我究竟做错了什么? 我该怎么做才能获得 powershell window 中显示的“Get-Team”命令的 output?

谢谢您的帮助。

Get-Team cmdlet 支持检索具有特定属性/信息的团队,包括特定用户所属的所有团队、已归档的所有团队、具有特定显示名称的所有团队或组织中的所有团队。

Get-Team
   [-User <String>]
   [-Archived <Boolean>]
   [-Visibility <String>]
   [-DisplayName <String>]
   [-MailNickName <String>]
   [-NumberOfThreads <Int32>]
   [<CommonParameters>]

参考: https://docs.microsoft.com/en-us/powershell/module/teams/get-team?view=teams-ps#examples

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM