user14695363
user14695363

Reputation:

How can I pass the output of a command (get-random) to a variable?

I've been trying to get a script to work in PowerShell. I am trying to pass the output of the command:

get-random -maximum 3 -minimum 1

to the variable $rand.

If you could explain it, that'd be great

Upvotes: 0

Views: 330

Answers (1)

The following should work

$rand = get-random -max 3 -min 1

Upvotes: 1

Related Questions