Variables/input

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #9224
    vaevictus
    Participant

    I’ve got quite a few scripts I run, remotely, locally, etc.

    Is there any way to, on a line-by-line basis perhaps, supply an additional piece of info for a workstation, to be utilized in a script?

    One example would be to pre-specify a string for a script to change the workstation description inside powershell.

    Currently, i’ve got this in Get-Information:

    cmd.exe /c echo . | powershell.exe -ExecutionPolicy Bypass -command “$x=gwmi win32_operatingsystem;$x.description=”[WORKSTATION DESCRIPTION HERE]”;$x.Put();”

    It works, but it’s clunky as I’ve gotta rewrite the description every time. Ideally, a popup requesting the description would be handy. $x.description=”$input” or something.

    Just looking for some best practice or suggestions. Thanks!

    #11292
    doug
    Moderator

    We have plans for a solution to this problem in a future version of the app. I’m not sure exactly what the timeline for implementation/release is.

    -Doug

    #11293
    vaevictus
    Participant

    As long as I’m not missing anything obvious. 😀

    It’d be nice to be able to use a grid column as input, or possibly several.

    Implementation will be a tricky thing, I’m sure.

    Thanks!

    #11294
    doug
    Moderator

    Yes, so currently there is only $computer for local commands, which pulls the host column value. However, in a future version we will likely add the ability to pull from a number of the other columns, such as $notes, $notes2, $description, $location etc. And they would be usable in not only local commands but also remote commands and get info commands.

    -Doug

    #10101
    vaevictus
    Participant

    Oh, did this ever happen?

    #10104
    doug
    Moderator

    Actually, coincidentally it’s already been added to the next version, which is coming soon. That is… in addition to $computer the ability to use $notes, $notes2, $location, $category, $description in local command/remote command/getinfo query/deployment.

    -Doug

    #9997
    jldwyer
    Participant

    Is it possible to run a remote command using a “prompted” variable? like Read-Host ….. in powershell?

    #9998
    doug
    Moderator

    No.

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.