当前位置:网站首页 > 更多 > 玩电脑 > 正文

[玩转系统] 适用于 Microsoft 团队的新 Powershell cmdlet

作者:精品下载站 日期:2024-12-14 07:12:07 浏览:12 分类:玩电脑

适用于 Microsoft 团队的新 Powershell cmdlet


大家好,

4 月 25 日是微软团队推出新版 powershell cmdlet 的日子。这次 cmdlet 处于测试状态。

https://www.powershellgallery.com/packages/MicrosoftTeams/0.9.3

该模块的安装非常简单。打开“管理”Powershell 或 ISE 会话。插入以下命令。

Install-Module MicrosoftTeams -Force -Verbose

[玩转系统] 适用于 Microsoft 团队的新 Powershell cmdlet

安装完成后重启powershell查看是否安装成功。

Import-Module MicrosoftTeams
Get-Module MicrosoftTeams

[玩转系统] 适用于 Microsoft 团队的新 Powershell cmdlet

乍一看测试版模块,没有什么革命性的变化。

https://github.com/MicrosoftDocs/office-docs-powershell/blob/master/teams/teams-ps/teams/New-Team.md

但 cmdlet 值得一看。

让我们看看可以用它们做什么:

$teams = @()
$teams = get-team
foreach ($team in $teams){

  $name = (($team.DisplayName).ToString())
  write-host "teamname: $name " -ForegroundColor Yellow
  $users = @()
  $users = Get-TeamUser -GroupId $team.groupid 
  $users |Format-Table User, Name,Role -AutoSize -Wrap
}

该脚本包含所有团队及其成员。

[玩转系统] 适用于 Microsoft 团队的新 Powershell cmdlet

此测试版中包含的功能非常有用。

玩得开心。

您需要 登录账户 后才能发表评论

取消回复欢迎 发表评论:

关灯