BatchPatch Forums Home › Forums › BatchPatch Support Forum › Variables/input
- This topic has 7 replies, 3 voices, and was last updated 7 years ago by doug.
-
AuthorPosts
-
June 27, 2016 at 9:36 pm #9224vaevictusParticipant
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!
June 27, 2016 at 9:39 pm #11292dougModeratorWe 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
June 27, 2016 at 9:45 pm #11293vaevictusParticipantAs 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!
June 27, 2016 at 9:48 pm #11294dougModeratorYes, 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
August 8, 2018 at 9:35 pm #10101vaevictusParticipantOh, did this ever happen?
August 8, 2018 at 10:05 pm #10104dougModeratorActually, 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
October 24, 2018 at 2:59 pm #9997jldwyerParticipantIs it possible to run a remote command using a “prompted” variable? like Read-Host ….. in powershell?
October 24, 2018 at 5:33 pm #9998dougModeratorNo.
-
AuthorPosts
- You must be logged in to reply to this topic.