GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — `Get-ScriptAnalyzerRule` default list view shows no value for property "Name" · Issue #2010 · PowerShell/PSScriptAnalyzer

Get-ScriptAnalyzerRule default list view shows no value for property "Name" #2010

New issue
Copy link
New issue
Copy link
Closed
#2011
Closed
Get-ScriptAnalyzerRule default list view shows no value for property "Name"#2010
#2011
Copy link

Description

@o-l-a-v
Olav Rønnestad Birkeland (o-l-a-v)
opened on Jul 7, 2024
Issue body actions

Before submitting a bug report:

  • Make sure you are able to repro it on the latest released version
  • Perform a quick search for existing issues to check if this bug has already been reported

Steps to reproduce

Get-ScriptAnalyzerRule -Name 'PSUseCorrectCasing' | Format-List

Expected behavior

PS > Get-ScriptAnalyzerRule -Name 'PSUseCorrectCasing' | Format-List

Name        : PSUseCorrectCasing
Severity    : Information
Description : For better readability and consistency, use the exact casing of the cmdlet/function/parameter.
SourceName  : PS

PS >

Actual behavior

PS > Get-ScriptAnalyzerRule -Name 'PSUseCorrectCasing' | Format-List

Name        : 
Severity    : Information
Description : For better readability and consistency, use the exact casing of the cmdlet/function/parameter.
SourceName  : PS

PS >

If an unexpected error was thrown then please report the full error details using e.g. $error[0] | Select-Object *

Environment data

> $PSVersionTable


Name                           Value
----                           -----
PSVersion                      7.4.3
PSEdition                      Core
GitCommitId                    7.4.3
OS                             Microsoft Windows 10.0.22631
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0



> (Get-Module -ListAvailable PSScriptAnalyzer).Version | ForEach-Object { $_.ToString() }

1.22.0
1.22.0

If selecting all properties with format list:

PS > Get-ScriptAnalyzerRule -Name 'PSUseCorrectCasing' | Format-List -Property '*'

RuleName         : PSUseCorrectCasing
CommonName       : Use exact casing of cmdlet/function/parameter name.
Description      : For better readability and consistency, use the exact casing of the cmdlet/function/parameter.
SourceType       : Builtin
SourceName       : PS
Severity         : Information
ImplementingType : Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules.UseCorrectCasing

PS >

Activity

  1. Olav Rønnestad Birkeland (o-l-a-v)
    changed the title [-]"PSScriptAnalyzer" default view shows no value for property "Name"[/-] [+]`Get-ScriptAnalyzerRule` default list view shows no value for property "Name"[/+] on Jul 7, 2024
  2. liamjpeters commented on Jul 8, 2024

    @liamjpeters
    Liam Peters (liamjpeters)
    on Jul 8, 2024
    Contributor
    More actions

    Hey Olav Rønnestad Birkeland (@o-l-a-v) 👋,

    This looks to be an issue with the format file definition, which outlines the default type definition of RuleInfo. It is referencing a Name property - which does not exist on the type.

    PSScriptAnalyzer/Engine/ScriptAnalyzer.types.ps1xml

    Lines 73 to 91 in ae898e7

    <Type>
    <Name>Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.RuleInfo</Name>
    <Members>
    <MemberSet>
    <Name>PSStandardMembers</Name>
    <Members>
    <PropertySet>
    <Name>DefaultDisplayPropertySet</Name>
    <ReferencedProperties>
    <Name>Name</Name>
    <Name>Severity</Name>
    <Name>Description</Name>
    <Name>SourceName</Name>
    </ReferencedProperties>
    </PropertySet>
    </Members>
    </MemberSet>
    </Members>
    </Type>

    I've put together a PR to update this to RuleName. This results in the below:

    image

    Thanks for flagging this! 🙂

    Reacted by Olav Rønnestad Birkeland
  3. Sydney Smith (SydneyhSmith)
    closed this as completedin #2011on Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.