Skip to content
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

Does this module still work through PowerShell 5.1? #639

Open
dbutch1976 opened this issue Nov 25, 2024 · 0 comments
Open

Does this module still work through PowerShell 5.1? #639

dbutch1976 opened this issue Nov 25, 2024 · 0 comments
Labels

Comments

@dbutch1976
Copy link

Describe the bug

Hello,
I'm having an issue with the VMware.vSphere.SsoAdmin module. I believe I have it loaded correctly and have the pre-reqs:
PSVersion 5.1.22621.4391
VMware.PowerCLI 13.3.0 build 24145081

I did the following:
#download Open Source PowerCLI Module for managing vCenter Single Sign-On (SSO) from https://github.com/vmware/PowerCLI-Example-Scripts
#unzip and import the module:
cd C:\Users\user1\Documents\WindowsPowerShell\Modules\VMware.vSphere.SsoAdmin
dir C:\Users\user1\Documents\WindowsPowerShell\Modules\VMware.vSphere.SsoAdmin* | Unblock-File
Import-Module ./VMware.vSphere.SsoAdmin.psd1
#runas administrator
Install-Module VMware.vSphere.SsoAdmin -Scope AllUsers

It looks to be installed correctly:
Get-Module:
ModuleType Version Name ExportedCommands
Script 1.0.0.0 ISE {Get-IseSnippet, Import-IseSnippet, New-IseSnippet}
Manifest 3.1.0.0 Microsoft.PowerShell.Management {Add-Computer, Add-Content, Checkpoint-Computer, Clear-Content...}
Manifest 3.0.0.0 Microsoft.PowerShell.Security {ConvertFrom-SecureString, ConvertTo-SecureString, Get-Acl, Get-AuthenticodeSignature...} Manifest 3.1.0.0 Microsoft.PowerShell.Utility {Add-Member, Add-Type, Clear-Variable, Compare-Object...} Script 1.4.8.1 PackageManagement {Find-Package, Find-PackageProvider, Get-Package, Get-PackageProvider...}
Script 2.2.5 PowerShellGet {Find-Command, Find-DscResource, Find-Module, Find-RoleCapability...}
Script 13.3.0.... VMware.VimAutomation.Common {Get-PowerCLIContext, Get-Task, New-OAuthSecurityContext, Stop-Task...}
Script 13.3.0.... VMware.VimAutomation.Sdk {Get-ErrorReport, EnableParameterCompleters, Get-InstallPath, Get-PSVersion}
Script 1.3.9 VMware.vSphere.SsoAdmin {Add-GroupToSsoGroup, Add-LDAPIdentitySource, Add-UserToSsoGroup, Connect-SsoAdminServer...}

When I attempt to use the Connect-SsoAdminServer -Server $viserver -credential $cred -SkipCertificateCheck I get:
Cannot find the type for custom attribute 'VMware.vSphere.SsoAdmin.Utils.StringToSecureStringArgumentTransformationAttribute'. Make sure that the assembly that contains this type is loaded.
At C:\Users\dbutc\Documents\WindowsPowerShell\Modules\VMware.vSphere.SsoAdmin\Connect.ps1:63 char:9

  •     [VMware.vSphere.SsoAdmin.Utils.StringToSecureStringArgumentTr ...
    
  •     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: ([VMware.vSphere...ionAttribute()]:AttributeAst) [], RuntimeException
    • FullyQualifiedErrorId : CustomAttributeTypeNotFound

However, when I do the exact same thing in Powershell7 it's working. Any idea why it's not working for me in PowerShell ISE? None of the commands from this module appear to be working.

Reproduction steps

  1. #download Open Source PowerCLI Module for managing vCenter Single Sign-On (SSO) from https://github.com/vmware/PowerCLI-Example-Scripts
  2. #unzip and import the module:
    cd C:\Users\user1\Documents\WindowsPowerShell\Modules\VMware.vSphere.SsoAdmin
    dir C:\Users\user1\Documents\WindowsPowerShell\Modules\VMware.vSphere.SsoAdmin* | Unblock-File
    Import-Module ./VMware.vSphere.SsoAdmin.psd1
  3. #runas administrator
    Install-Module VMware.vSphere.SsoAdmin -Scope AllUsers

Attempt to run Connect-SsoAdminServer

Expected behavior

Should connect, instead I get the following error which does not occur in PS7:
'VMware.vSphere.SsoAdmin.Utils.StringToSecureStringArgumentTransformationAttribute'. Make sure that the assembly that contains this type is loaded.
At C:\Users\dbutc\Documents\WindowsPowerShell\Modules\VMware.vSphere.SsoAdmin\Connect.ps1:63 char:9

  •     [VMware.vSphere.SsoAdmin.Utils.StringToSecureStringArgumentTr ...
    
  •     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: ([VMware.vSphere...ionAttribute()]:AttributeAst) [], RuntimeException
    • FullyQualifiedErrorId : CustomAttributeTypeNotFound

Additional context

No response

@dbutch1976 dbutch1976 added the bug label Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant