Jump to content

run powerhsell command with input


levila
 Share

Recommended Posts

Hi,

I cant figure out how to run command in powershell with input value after that. My purpose is to run one single click autoit that can push to register new PS name on powershell.

Here is my current script.

#include <AutoItConstants.au3>

$CMD = 'New-PSDrive'

RunWait('"' & @ComSpec & '" /c Powershell.exe ' & $CMD, @SystemDir)

and the screenshot was like this

Capture.JPG.f02e0f8c02c1fd3201ab69a3fff9a75c.JPG

Big appreciate if u guys can help.

 

Thanks

 

 

Edited by levila
misspell
Link to comment
Share on other sites

have the user supply it beforehand, something like:

$sName = inputbox('put yer name here'.........

$CMD = 'New-psDrive ' & $sName

 

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...