thycotic-ps / thycotic.secretserver

PowerShell module for automating with Thycotic Secret Server REST API
https://thycotic-ps.github.io/thycotic.secretserver
MIT License
68 stars 22 forks source link

Please fix Bad Thycotic.SecretServer v0.60.6 Module folders distributed under the latest Assets #273

Closed MaximoTrinidad closed 2 years ago

MaximoTrinidad commented 2 years ago

Verified issue does not already exist?

No

What error did you receive

Before I continue! Both zip and rar files are badly built! thycoticModule zipped_2022-04-18_10-32-25

Import-Module -Name Thycotic.SecretServer
Import-Module : The module to process 'C:\Users\max_t\OneDrive\Documents\WindowsPowerShell\Modules\Thycotic.Secretserve
r\Thycotic.SecretServer\bin\Debug\netstandard2.0\Thycotic.SecretServer.dll', listed in field 'NestedModules' of module
manifest
'C:\Users\max_t\OneDrive\Documents\WindowsPowerShell\Modules\Thycotic.Secretserver\Thycotic.Secretserver.psd1' was not
processed because no valid module was found in any module directory.
At line:1 char:1
+ Import-Module -Name Thycotic.Secretserver
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (Thycotic.Secretserver:String) [Import-Module], PSInvalidOperationE
   xception
    + FullyQualifiedErrorId : Modules_ModuleFileNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand

At the same time the *psd1 file contains errors which is the causing of the module loading error:

  1. Wrong module version number Thycotic_misising_01

  2. Wrong nested module path defined. Thycotic_misising_02

I wonder who's doing the QA and Validation of this Moule built before posting it to the Asset page?

Please run the command using -Verbose

PS [34] > Import-Module -Name Thycotic.Secretserver -verbose
VERBOSE: Loading module from path
'C:\Users\max_t\OneDrive\Documents\WindowsPowerShell\Modules\Thycotic.Secretserver\Thycotic.Secretserver.psd1'.
VERBOSE: Loading 'TypesToProcess' from path
'C:\Users\max_t\OneDrive\Documents\WindowsPowerShell\Modules\Thycotic.Secretserver\Thycotic.SecretServer.Types.ps1xml'.
VERBOSE: Loading 'FormatsToProcess' from path
'C:\Users\max_t\OneDrive\Documents\WindowsPowerShell\Modules\Thycotic.Secretserver\Thycotic.SecretServer.Format.ps1xml'
.
Import-Module : The module to process 'C:\Users\max_t\OneDrive\Documents\WindowsPowerShell\Modules\Thycotic.Secretserve
r\Thycotic.SecretServer\bin\Debug\netstandard2.0\Thycotic.SecretServer.dll', listed in field 'NestedModules' of module
manifest
'C:\Users\max_t\OneDrive\Documents\WindowsPowerShell\Modules\Thycotic.Secretserver\Thycotic.Secretserver.psd1' was not
processed because no valid module was found in any module directory.
At line:1 char:1
+ Import-Module -Name Thycotic.Secretserver -verbose
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (Thycotic.Secretserver:String) [Import-Module], PSInvalidOperationE
   xception
    + FullyQualifiedErrorId : Modules_ModuleFileNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand

Also, the module folder structure is not consistent with the previous version (v 0.60.5) which v0.60.6 is missing the version folder. Thycotic_misising_03

Provide a test case or steps to reproduce

N/A as the unzipped nor the unrar folder won't import the module!

Expected behavior

To load the module without any errors. and should work in both Windows PowerShell 5.0 and PowerShell 7.2.1.

As I made the changes myself, to find out the module works only in PowerShell 7.2.1 and not Window PowerShell 5.0.

Last error preventing the fixes to loads in Windows PowerShell 5.1:

PS [22] > import-module Thycotic.SecretServer
import-module : The following error occurred while loading the extended type data file: , C:\Users\max_t\OneDrive\Docum
ents\WindowsPowerShell\Modules\Thycotic.SecretServer\0.60.6\Thycotic.SecretServer.Types.ps1xml: The file was skipped
because of the following validation exception: File C:\Users\max_t\OneDrive\Documents\WindowsPowerShell\Modules\Thycoti
c.SecretServer\0.60.6\Thycotic.SecretServer.Types.ps1xml cannot be loaded. The file C:\Users\max_t\OneDrive\Documents\W
indowsPowerShell\Modules\Thycotic.SecretServer\0.60.6\Thycotic.SecretServer.Types.ps1xml is not digitally signed. You
cannot run this script on the current system. For more information about running scripts and setting execution policy,
see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170..
At line:1 char:1
+ import-module Thycotic.SecretServer
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Import-Module], RuntimeException
    + FullyQualifiedErrorId : FormatXmlUpdateException,Microsoft.PowerShell.Commands.ImportModuleCommand

So SAD!

What Edition of Secret Server?

Platinum

What version of Secret Server

11.0

What PowerShell host was used when producing this error

Windows PowerShell (powershell)

PowerShell Host Version

Name Value


PSVersion 5.1.22000.652
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.22000.652
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

``

EndlessTrax commented 2 years ago

@MaximoTrinidad Thank you for your feedback.

I've updated the .zip in the release which should fix 1. and 2. from above.

As for the version folder in 0.60.5, I don't see that in the release zip for that version either. So I'm not sure why your version is different.

MaximoTrinidad commented 2 years ago

@EndlessTrax,

I appreciate getting the help in getting it corrected!

".... I don't see that in the release zip for that version either. ..." -> That's because you guys didn't have it available until I mention it.

"...I'm not sure why your version is different." -> the reason is simple: module v0.60.5 was built while using "Install-module -name thycotic.secretServer -scope CurrentUser -Repository PSGallery".

Now more feedback: Why the quick draw to close this issue without having the issuer confirmed it has been resolved.

Ok.. some confirmation... the module is finally functional but there are some functions that are having issues building the PSObject output.

Of course, I will create issues about these broken functions, when times allow.