0

我正在尝试在新的 azure 函数服务上编写一个 powershell 函数。基本工作正常,但是当我尝试为我的 Exchange O365 租户创建一个新的远程会话时,该函数在到达 New-PSSession 行时会停止处理。在 azure automatic powershell 中创建远程会话没有问题。我在这里错过了什么吗?

Get-PSSession | Remove-PSSession
$username = "xxxx"
$password = convertto-securestring "yyyyy" -asplaintext -force
$Creds = new-object -typename System.Management.Automation.PSCredential -argumentlist $username, $password
$Session = New-PSSession -ConnectionUri "https://outlook.office365.com/powershell-liveid/" -Credential $Creds -Authentication Basic -AllowRedirection
Import-PSSession -Session $Session
4

0 回答 0