Inkscape.org
Beyond the Basics Querying information in Powershell
  1. #1
    Sayse Sayse @Sayse
    *

    Whenever I try to query information about a file in Powershell, it gives me nothing.  When I run a command like

    inkscape --query-all file.svg

    or

    inkscape --actions="query-x" file.svg

    It gives me nothing.  Just goes straight to the new line.  Whenever I run the same command in a batch file, it works just fine.

    If I run a command to edit/output a new file in powershell like

    inkscape --actions="select:$id;transform-rotate:$ang;export-filename:$fname;export-do;" $file.svg

    works just fine.
     

    I also tried commands like --actions-list and --verb-list and can't get anything either in powershell.

    Can anyone help with why I'm unable to query information?

    I also have
    set-alias inkscape "C:\Program Files\Inkscape\bin\inkscape.exe"

    at the beginning of all my powershell scripts to call inkscape that way

    EDIT: I figured it out.

    Whenever I do
    set-alias inkscape "C:\Program Files\Inkscape\bin\inkscape.com"

    instead of .exe, it lets me bring up information.  Querying, --action-list, --verb-list, etc all bring up information now.  Won't let me do actions that edit my files, so I guess I just gotta set aliases for both.  

  2. #2
    inklinea inklinea @inklinea⛰️

    I hardly ever use powershell

    I sounds like an issue with the powershell stdout settings.

    https://powershell.one/code/9.html

    There is a command about halfway down - Get-Variable -Name *preference

    Might give a clue if a stream has been set to 'SilentlyContinue' or something simliar

    My powershell version 5.1.19041.1151 on Windows 10 by default works correctly.

    It's output from the command above is:

    Name                           Value
    ----                           -----
    ConfirmPreference              High
    DebugPreference                SilentlyContinue
    ErrorActionPreference          Continue
    InformationPreference          SilentlyContinue
    ProgressPreference             Continue
    VerbosePreference              SilentlyContinue
    WarningPreference              Continue
    WhatIfPreference               False

    This Microsoft page https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_output_streams?view=powershell-7.1

    Gives more info on streams, but beyond that - I honestly don't know

Inkscape Inkscape.org Inkscape Forum Beyond the Basics Querying information in Powershell