-
Notifications
You must be signed in to change notification settings - Fork 7.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add-AdfsWebApiApplication command not working in Powershell 7 #12406
Comments
It is ADFS 2019 on Windows Server 2019. Just to clarify. |
Can you check I'm wondering if it's being imported as a script module via Windows PS implicit remoting instead... |
I got a Windows PS implicit remoting progress bar thingy though when I executed that command. |
Hmm. I could be wrong, but If it's that specific type check that's failing, I'd be inclined to assume that Windows PS isn't able to properly reconstruct the hashtable on that side of the remoting connection, so the type check fails. You can try instead importing the module directly in powershell 7 with Import-Module and see if you can get it to import directly into powershell 7 without the remoting in-between. |
/cc @anmenaga for information. |
What is the runtime type of variable Couple of possible workarounds:
$CustomerId = "TestCustomerId"
$HostName = "TestHostName"
$CustomerGroup = "TestCustomerGroup"
$s = Get-PSSession -Name WinPSCompatSession -ErrorAction SilentlyContinue
if (-not $s) {Import-Module ADFS -UseWindowsPowerShell;$s = Get-PSSession -Name WinPSCompatSession}
Invoke-Command -Session $s -ScriptBlock { Setup-AdfsApplicationGroup.ps1 $using:CustomerId $using:HostName $using:CustomerGroup }
|
@anmenaga Second workaround is not working. I'm getting these errors when calling methods from the imported module.
|
And i can't really tell what the runtime type of But I tried to explicitly make a I was only using PS7 because I like to use the new stuff for dev. So PS7 is not really a requirement for me. I just wanted to report this issue I had with PS7. |
ADFS module is not supported by PowerShell Core. Please request the support in https://github.com/PowerShell/PowerShellModuleCoverage
|
This issue has been marked as external and has not had any activity for 1 day. It has been be closed for housekeeping purposes. |
Steps to reproduce
Specifically this bit is the problem.
Expected behavior
Should run and create an AdfsWebApplication
Actual behavior
Additional information
I used dotPeak to look into
Microsoft.IdentityServer.dll
. The problem seems to be the following check inside theParameterInterface.cs
AssignSpecificClaimParemeterFromPSHInput
method , which is not working in PowerShell 7 but is working in PowerShell 5.1The content of the variable
value
is the content that got passed into theAccessControlPolicyParameters
parameter of theAdd-AdfsWebApiApplication
command.It does not matter what you put into the
AccessControlPolicyParameters
parameter. It always triggers this check and throws the exception.Environment data
The text was updated successfully, but these errors were encountered: