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

ConvertFrom-TextTable yum repolist --all fails #39

Open
3 tasks done
ThomasNieto opened this issue Jul 25, 2023 · 1 comment
Open
3 tasks done

ConvertFrom-TextTable yum repolist --all fails #39

ThomasNieto opened this issue Jul 25, 2023 · 1 comment
Milestone

Comments

@ThomasNieto
Copy link

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest version
  • Search the existing issues.

Steps to reproduce

If you try to parse yum repolist --all | ConvertFrom-TextTable -Skip 4 it will error.

Here is the output from yum.

Updating Subscription Management repositories.
Unable to read consumer identity
Subscription Manager is operating in container mode.

This system is not registered with an entitlement server. You can use subscription-manager to register.

repo id                               repo name                                                           status
packages-microsoft-com-prod           packages-microsoft-com-prod                                         enabled
ubi-8-appstream-debug-rpms            Red Hat Universal Base Image 8 (Debug RPMs) - AppStream             disabled
ubi-8-appstream-rpms                  Red Hat Universal Base Image 8 (RPMs) - AppStream                   enabled
ubi-8-appstream-source                Red Hat Universal Base Image 8 (Source RPMs) - AppStream            disabled
ubi-8-baseos-debug-rpms               Red Hat Universal Base Image 8 (Debug RPMs) - BaseOS                disabled
ubi-8-baseos-rpms                     Red Hat Universal Base Image 8 (RPMs) - BaseOS                      enabled
ubi-8-baseos-source                   Red Hat Universal Base Image 8 (Source RPMs) - BaseOS               disabled
ubi-8-codeready-builder               Red Hat Universal Base Image 8 (RPMs) - CodeReady Builder           disabled
ubi-8-codeready-builder-debug-rpms    Red Hat Universal Base Image 8 (Debug RPMs) - CodeReady Builder     disabled
ubi-8-codeready-builder-rpms          Red Hat Universal Base Image 8 (RPMs) - CodeReady Builder           enabled
ubi-8-codeready-builder-source        Red Hat Universal Base Image 8 (Source RPMs) - CodeReady Builder    disabled

Expected behavior

parses

Actual behavior

ConvertFrom-TextTable: Cannot process argument because the value of argument "name" is not valid. Change the value of the "name" argument and run the operation again.

Error details

Exception             :
    Type        : System.Management.Automation.PSArgumentException
    ErrorRecord :
        Exception             :
            Type    : System.Management.Automation.ParentContainsErrorRecordException
            Message : Cannot process argument because the value of argument "name" is not valid. Change the value
 of the "name" argument and run the operation again.
            HResult : -2146233087
        CategoryInfo          : InvalidArgument: (:) [], ParentContainsErrorRecordException
        FullyQualifiedErrorId : Argument
    Message     : Cannot process argument because the value of argument "name" is not valid. Change the value of
the "name" argument and run the operation again.
    ParamName   : name
    TargetSite  : Void .ctor(System.String, System.Object)
    Source      : System.Management.Automation
    HResult     : -2147024809
    StackTrace  :
   at System.Management.Automation.PSNoteProperty..ctor(String name, Object value)
   at TextTableParser.ConvertTextTableCommand.GetPsObject(List`1 cInfos, String line, String[] columnHeaders) in
D:\a\_work\1\s\TextUtility\src\code\TextTableParser.cs:line 242
   at TextTableParser.ConvertTextTableCommand.Emit(String line) in D:\a\_work\1\s\TextUtility\src\code\TextTableP
arser.cs:line 167
   at TextTableParser.ConvertTextTableCommand.EndProcessing() in D:\a\_work\1\s\TextUtility\src\code\TextTablePar
ser.cs:line 150
   at System.Management.Automation.CommandProcessorBase.Complete()
CategoryInfo          : InvalidArgument: (:) [ConvertFrom-TextTable], PSArgumentException
FullyQualifiedErrorId : Argument,TextTableParser.ConvertTextTableCommand
InvocationInfo        :
    MyCommand        : ConvertFrom-TextTable
    ScriptLineNumber : 1
    OffsetInLine     : 22
    HistoryId        : 165
    Line             : yum repolist --all | ConvertFrom-TextTable -Skip 4
    PositionMessage  : At line:1 char:22
                       + yum repolist --all | ConvertFrom-TextTable -Skip 4
                       +                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    InvocationName   : ConvertFrom-TextTable
    CommandOrigin    : Internal
ScriptStackTrace      : at <ScriptBlock>, <No file>: line 1

Environment data

7.4

Version

0.5.0

Visuals

No response

@ThomasNieto ThomasNieto changed the title yum repolist --all fails ConvertFrom-TextTable yum repolist --all fails Jul 25, 2023
@SteveL-MSFT SteveL-MSFT added this to the 1.0 Consider milestone Jul 25, 2023
@ThomasNieto
Copy link
Author

This may be caused by a space in the second column. The parser is able to handle renaming spaces to underscore in the first column.

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

2 participants