xmouser
asked on
Powershell error
I keep getting this error:
PowerCLI C:\> "test.ps1" -AfterDate 08/21/2012 -FileName C:\Report.txt
You must provide a value expression on the right-hand side of the '-' operator.
At line:1 char:13
+ "test.ps1" - <<<< AfterDate 08/21/2012 -FileName C:\Report.txt
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordE x
ception
+ FullyQualifiedErrorId : ExpectedValueExpression
I've changed the date several times. I'm assuming this is realated to the format of the date but I can't seem to get it to work.
PowerCLI C:\> "test.ps1" -AfterDate 08/21/2012 -FileName C:\Report.txt
You must provide a value expression on the right-hand side of the '-' operator.
At line:1 char:13
+ "test.ps1" - <<<< AfterDate 08/21/2012 -FileName C:\Report.txt
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordE
ception
+ FullyQualifiedErrorId : ExpectedValueExpression
I've changed the date several times. I'm assuming this is realated to the format of the date but I can't seem to get it to work.
ASKER
That's how I started:
Suggestion [3,General]: The command test.ps1 was not found, but does exist in th
e current location. Windows PowerShell doesn't load commands from the current lo
cation by default. If you trust this command, instead type ".\test.ps1". See "ge
t-help about_Command_Precedence" for more details.
That's why I put the quotes around it.
Also tried it with ".\test.ps1"
Suggestion [3,General]: The command test.ps1 was not found, but does exist in th
e current location. Windows PowerShell doesn't load commands from the current lo
cation by default. If you trust this command, instead type ".\test.ps1". See "ge
t-help about_Command_Precedence" for more details.
That's why I put the quotes around it.
Also tried it with ".\test.ps1"
If I read (and count) it correctly it has to do with the "/" in the date.
ASKER
The script as posted at MS has it in the format that I'm using. There the example was 09/09/09. How should it be?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I'm getting this:
PowerCLI C:\> & ".\test.ps1" -AfterDate 08/21/2012 -FileName C:\Report.txt
Missing closing ')' in expression.
At C:\test.ps1:40 char:12
+ <<<< [String]
+ CategoryInfo : ParserError: (CloseParenToken:TokenId) [], Parse
Exception
+ FullyQualifiedErrorId : MissingEndParenthesisInExp ression
PowerCLI C:\> & ".\test.ps1" -AfterDate 08/21/2012 -FileName C:\Report.txt
Missing closing ')' in expression.
At C:\test.ps1:40 char:12
+ <<<< [String]
+ CategoryInfo : ParserError: (CloseParenToken:TokenId) [], Parse
Exception
+ FullyQualifiedErrorId : MissingEndParenthesisInExp
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Thanks for the points,
D
D
Cheers,
D