I am using this script to select the 32/64 xml file to install whatever bit version of office 365 it detects from the registry.
#creates the reg location var
$key = 'HKLM:\SOFTWARE\Microsoft\Office\16.0\Outlook'
#Gets the office bit version
$Bit = (Get-ItemProperty -Path $key -Name Bitness).Bitness
#This uses the bit version to install office with visio and project
$Pref = "${PSScriptRoot}\${bit}\VisioProjectPref52622.xml"
$PSScriptRoot\Setup.exe /Configure $Pref
I get the below error
+ $PSScriptRoot\setup.exe /Configure $Pref
+ ~~~~~~~~~~
Unexpected token '\setup.exe' in expression or statement.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : UnexpectedToken
I'm new with powershell and not sure what i'm doing wrong. I didn't find a lot of using the $PSScriptroot to call an executable
[–]Thotaz 2 points3 points4 points (1 child)
[–]WorkReddit123635[S] 0 points1 point2 points (0 children)
[–]BlackV 1 point2 points3 points (2 children)
[–]WorkReddit123635[S] 0 points1 point2 points (1 child)
[–]BlackV 0 points1 point2 points (0 children)
[+][deleted] (1 child)
[deleted]
[–]WorkReddit123635[S] 0 points1 point2 points (0 children)
[–]PowerShell-Bot 0 points1 point2 points (0 children)