Azure-Samples / Azure-Samples/azure-files-samples

Test AzFilesHybrid.psm1 in Powershell Core

Open
#58 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.