Powershell installatie script

Status
Niet open voor verdere reacties.

SontriaX

Gebruiker
Lid geworden
20 sep 2005
Berichten
230
Goedemiddag helpmij leden.

Ik zit al een tijdje te puzzelen waarom het Powershell installatiescript niet werkt.
Wellicht is het voor jullie vrij simpel te achterhalen :d

# Verify C:\ProgramData\SontriaXLogs exits
if (!(test-path -path "C:\ProgramData\SontriaXLogs"))
{New-Item -ItemType Directory -Path "C:\ProgramData\SontriaXLogs" -force}

#Set variables
$ScriptRoot = Split-Path $MyInvocation.MyCommand.path
$InstallFile = "$ScriptRoot\FirefoxSetup111.0.14.msi”
$Arguments = "/S /Desktopshortcut=false /PreventRebootRequired=true"

#Install Firefox
Start-Process -Filepath $InstallFile -Argumentlist $Arguments /L*v “C:\ProgramData\SontriaXLogs\InstallFirefox111.0.14.x64.txt”
 
Laatst bewerkt:
Wat gebeurt er dan wel precies?
'Het werkt niet' is vrij algemeen.
 
Dit is de foutmelding die ik terugkrijg van Powershell.

Split-Path : Cannot bind argument to parameter 'Path' because it is null.
At line:6 char:26
+ $ScriptRoot = Split-Path $MyInvocation.MyCommand.path
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: :)) [Split-Path], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.SplitPathCommand

Start-Process : A positional parameter cannot be found that accepts argument '/L*v'.
At line:11 char:1
+ Start-Process -Filepath $InstallFile -Argumentlist $Arguments /L*v “C ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: :)) [Start-Process], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.StartProcessCommand
 
Status
Niet open voor verdere reacties.
Terug
Bovenaan Onderaan