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

Powershell 7 PSEdition Core #591

Open
cliveontoast opened this issue Sep 29, 2020 · 0 comments
Open

Powershell 7 PSEdition Core #591

cliveontoast opened this issue Sep 29, 2020 · 0 comments

Comments

@cliveontoast
Copy link

Hi,

When I run my pickles in powershell v5 (PSEdition Desktop) the command works well.
Running in powershell v7 (PSEdition Core) doesn't work.

I understand this is probably because pickles is not build to work from powershell core edition. So it's not really much of an issue. I thought it was useful to describe the problem at least because google didn't help me initially.

If I do have capacity myself, it would be an interesting exercise to try to fix it myself.

Version 2 needs .NET 4.5 - this may be a breaking change for some, but the download sizes are much smaller now. Pickles should run faster too.

My script file Pickles_documentation.ps1 looks as follows:

# Setup variables
$root = "."
$FeatureDirectory = "$root\Features"
$DocumentationFormat = "dhtml"
$OutputDirectory = "$root\Docs\$DocumentationFormat"

# Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted
Import-Module $env:USERPROFILE\.nuget\packages\pickles\**\tools\PicklesDoc.Pickles.Powershell.dll
 
Pickle-Features -FeatureDirectory $FeatureDirectory -OutputDirectory $OutputDirectory -DocumentationFormat   $DocumentationFormat

PS C:\xxx.Specs> .\Pickles_documentation.ps1
WARNING: The names of some imported commands from the module 'PicklesDoc.Pickles.PowerShell' include unapproved verbs that might make them less discoverable. To find the commands with unapproved verbs, run the Import-Module command again with the Verbose parameter. For a list of approved verbs, type Get-Verb.
Pickles v.2.21.0.0

Generating documentation based on the following parameters
----------------------------------------------------------
Feature Directory              : C:\xxx.Specs\Features
Output Directory               : C:\xxx.Specs\Docs\dhtml
Project Name                   : 
Project Version                : 
Language                       : en
Incorporate Test Results?      : No
Include Experimental Features? : No
Exclude Tag                    : 
Technical Tag                    : 
Pickles completed successfully

PS C:\xxx.Specs> $PSversionTable                                                                                      
Name                           Value
----                           -----
PSVersion                      5.1.18362.752
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.18362.752
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

When I run it in powershell v7 it crashes

PS C:\xxx.Specs> .\Pickles_documentation.ps1
WARNING: The names of some imported commands from the module 'PicklesDoc.Pickles.PowerShell' include unapproved verbs that might make them less discoverable. To find the commands with unapproved verbs, run the Import-Module command again with the Verbose parameter. For a list of approved verbs, type Get-Verb.
Pickles v.2.21.0.0

Generating documentation based on the following parameters
----------------------------------------------------------
Feature Directory              : C:\xxx.Specs\Features
Output Directory               : C:\xxx.Specs\Docs\dhtml
Project Name                   :
Project Version                :
Language                       : en
Incorporate Test Results?      : No
Include Experimental Features? : No
Exclude Tag                    :
Technical Tag                    :
Pickle-Features: C:\xxx.Specs\Pickles_documentation.ps1:10
Line |
  10 |  Pickle-Features -FeatureDirectory $FeatureDirectory -OutputDirectory  …
     |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Could not load type 'System.Web.Util.Utf16StringValidator' from assembly 'System.Web, Version=4.0.0.0,
     | Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.

PS C:\xxx.Specs> $PSversionTable

Name                           Value
----                           -----
PSVersion                      7.0.3
PSEdition                      Core
GitCommitId                    7.0.3
OS                             Microsoft Windows 10.0.18363
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
@cliveontoast cliveontoast changed the title P Powershell 7 PSEdition Core Oct 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant