Hi I am new to powershell and I am having a problem running a script that I have modified to install software from my usb key
The USB key is a 64 GB stick partitioned into four drives w:, x:, y: and z:
I am running this script
Function Install-Software
{
PARAM
(
$file = “Z:\scripts\Adobe Photoshop CS6 Extended\SOFTWARE\Set-up.exe”,
$Arguments =‘/q CONTENT_DIR=“Z:\scripts” DEFAULT_WEBSITE=0 CONTENT_LOCAL=1’
)
$Install = Start-Process $File -ArgumentList $Arguments -Wait -PassThru
If($Install.ExitCode -eq 0){
Write-Host "Installation was OK" -ForegroundColor GREEN
}
Else
{
Write-Host "Installation failed $("$Install.ExitCode")" -ForegroundColor RED
}
}
No matter what I do I always get this error:
PS Z:\Scripts> .\script.ps1
Missing ‘)’ in function parameter list.
At Z:\Scripts\Script.ps1:4 char:13
-
$Z: <<<< \scripts\Adobe Photoshop CS6 Extended\SOFTWARE\Set-up.exe- CategoryInfo : ParserError: (CloseParenToken:TokenId) , Parse
Exception - FullyQualifiedErrorId : MissingEndParenthesisInFunctionParameterList
- CategoryInfo : ParserError: (CloseParenToken:TokenId) , Parse
PS Z:\Scripts>
But as you can see there is definately a ) there. I know it is just a simple syntax error but blowed if I can find out what is wrong with this script
Any help would be great
Tim