1

In PowerShell V3, I am having issue with Get-Website command.

Whenever I do

PS c:\> Get-Website -Name "MyWebsite" 

It returns all the websites on that server. It is either the command is behaving differently or I am getting it wrong.

If I do a Get-type on the returned object then it is of type Array. If I understand it right then it should only return one website.

Please advise.

Mitul
  • 9,734
  • 4
  • 43
  • 60
  • 1
    This should help: http://stackoverflow.com/questions/4170530/powershell-get-website-name-parameter-is-ignored/8772609#8772609 – David Martin Nov 10 '12 at 06:47

1 Answers1

4

Apparently there is a bug with the command bug link

Wrapping the name in wildcard characters works:

  get-website -name "*MyWebsite*"