Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In the CLI itself

$foo = (Get-ADGroupMembers -identity"blah_SEC")
echo $foo

Works.

But when I do the same exact thing in a .ps1 file it says the parameters are missing and prompts me to input them.

share|improve this question
    
I don't know why you're getting a "missing parameter" error. You should actually be getting a bit worse. Firstly, you'll get a "command not found" type of error - the command is Get-ADGroupmember, not Get-ADGroupMembers. After that, you should get a "cannot find an object with identity:" error because there's no space between -Identity and "blah_SEC". After you fix that in your script, try putting a semicolon at the end of the first line for good measure and see if it works. – Iszi Oct 1 '15 at 16:07

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.