Azure-Samples / Azure-Samples/azure-files-samples
Test AzFilesHybrid.psm1 in Powershell Core
Open
- Dominant language
- PowerShell
- Stars
- 261
- Forks
- 202
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 4
Description
File :
Line : 2533
if ($null -ne $computerSpnMatch) {
$computerSpnMatch.AllowReversiblePasswordEncryption = $false
$computerSpnMatch.Description = "Computer account object for Azure storage account $StorageAccountName."
$computerSpnMatch.Enabled = $true
Set-ADComputer -Instance $computerSpnMatch -ErrorAction Stop
}
This code is not working in powershell core (7.1) as Set-ADComputer will run as Invoke-Command internally in 5.1 for compatible mode.
Quick Fix:
Use Invoke-WinCommand -ScriptBlock { }
Contributor guide
Assessment
This issue has not been assessed yet.