The CD command is not working under the Windows PowerShell
I receive the following error message:
PS C:\> cd /Program Files
Set-Location : A positional parameter cannot be found that accepts argument 'Files'.
At line:1 char:3
+ cd <<<< /Program Files
+ CategoryInfo : InvalidArgument: (:) [Set-Location], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.SetLocationCommand
January 5th, 2012 12:05am
Why don't you use tab completion?
If you were, then you would see that the command would be:
cd '.\Program Files' (because of the space between program and files)
..but less typing with tab completion :)
Martina Miskovic - http://www.nic2012.com/
Free Windows Admin Tool Kit Click here and download it now
January 5th, 2012 12:29am
It's because I'm a PowerShell Beginner and was not aware that I needed to use '.\Program Files' when there is a space between the command. I'm trying to install the Anti-Spam Agents. Here is what I get:
PS C:\Program Files\Microsoft\Exchange Server\V14\Scripts> ./install-AntispamAgents.ps1
The term 'get-transportserver' is not recognized as the name of a cmdlet, function, script file, or operable program. C
heck the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Program Files\Microsoft\Exchange Server\V14\Scripts\install-AntispamAgents.ps1:15 char:39
+ $transportserver = get-transportserver <<<< -id $localservername
+ CategoryInfo : ObjectNotFound: (get-transportserver:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Failed to find the Transport server: MSWLMX
PS C:\Program Files\Microsoft\Exchange Server\V14\Scripts>Alfred Aragon IT Consultant
January 5th, 2012 12:54am
Hi,
tab completion is very handy.
You need to start Exchange Managment Shell (EMS) so that the Exchange cmdlets is loaded and run the script ./install-AntispamAgents.ps1
Martina Miskovic - http://www.nic2012.com/
Free Windows Admin Tool Kit Click here and download it now
January 5th, 2012 12:58am
Just to confirm, the script ./install-AntispamAgents.ps1 needs to be executed from the
Exchange Managment Shell (EMS) and NOT the Windows PowerShellAlfred Aragon IT Consultant
January 5th, 2012 2:25am
On Thu, 5 Jan 2012 07:15:36 +0000, alfhgon wrote:
>Just to confirm, the script ./install-AntispamAgents.ps1 needs to be executed from the Exchange Managment Shell (EMS) and NOT the Windows PowerShell
That's correct.
---
Rich Matheisen
MCSE+I, Exchange MVP
--- Rich Matheisen MCSE+I, Exchange MVP
Free Windows Admin Tool Kit Click here and download it now
January 6th, 2012 9:53pm
Hi
Any update?
Cheers
Zi Feng
January 7th, 2012 3:19am
Incredible, Simple and WORKS!!!
Thank you Martina :)Emilio I. Wilde
Free Windows Admin Tool Kit Click here and download it now
January 28th, 2012 10:48pm