Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Make a variable runable

$
0
0

Tried searching the forum but I dont really know how to search for this, Sorry if its been asked.  Trying to make a variable as part of a script.  Very simplified example would be:

$Command = Read-Host "Enter Command to Run"
$Command

If I type Get-Host it simply feeds Get-Host to the console.  Is there a simple way to do this without outputing $command to a file and then doing a Get-Content on the file.

Thanks!


Viewing all articles
Browse latest Browse all 6937

Trending Articles