Packager 32 bit vs 64 bit question
Posted: Tue Oct 06, 2015 8:02 am
PrimalScript 2015 7.1.69
64 bit
TLDR; My 32 bit PowerShell packages do not run on 64 bit computers. Is this by design or an error on my part?
I am trying to package a script to be used in a Windows 7 environment with a mix of 32 bit and 64 bit Windows. I have attached a sample of my packager settings. Most computers in the environment only have PowerShell v2.0 installed, so I have to program for the lowest common denominator.
I am finding that my 32 bit version of the package will not execute on 64 bit systems. It "runs", but does not execute the packaged script (no scripted actions performed) and does not return an error message. I am running the scripts elevated.
The same 32 bit version works correctly on a 32 bit computer and the 64 bit version works correctly on a 64 bit computer.
Is this by design or am I misconfiguring in some way?
I have had this problem with both the Sapien V2 Host and the PowerShell Command line engine.
I am including the PowerShell script for reference. FYI, I am using the "$result =" pattern to cut down on output, though when I run the package on a remote computer, I am using the /s command line parameter.
Set-StrictMode -Version 2.0
$ErrorActionPreference = 'SilentlyContinue'
function Main () {
$result = Remove-ItemProperty -Path 'hklm:Software\Microsoft\Windows\CurrentVersion\WindowsUpdate' -Name 'SusClientID' -Force
$result = Remove-ItemProperty -Path 'hklm:Software\Microsoft\Windows\CurrentVersion\WindowsUpdate' -Name 'SusClientIDValidation' -Force
$result = Stop-Service wuauserv
$result = rm c:\windows\SoftwareDistribution -force -recurse
$result = Start-Service wuauserv
$result = wuauclt /detectnow
$successRegKeyPath = 'hklm:Software\company\Infrastructure'
$executionTime = (get-date -format 'yyyy-MM-dd hh:mm:ss')
$result = New-Item -Path $successRegKeyPath -Force
$result = New-ItemProperty $successRegKeyPath -Name "RepairWSUS_Execution" -Value $executionTime -PropertyType String
}
. Main
$ExitCode = 0
64 bit
TLDR; My 32 bit PowerShell packages do not run on 64 bit computers. Is this by design or an error on my part?
I am trying to package a script to be used in a Windows 7 environment with a mix of 32 bit and 64 bit Windows. I have attached a sample of my packager settings. Most computers in the environment only have PowerShell v2.0 installed, so I have to program for the lowest common denominator.
I am finding that my 32 bit version of the package will not execute on 64 bit systems. It "runs", but does not execute the packaged script (no scripted actions performed) and does not return an error message. I am running the scripts elevated.
The same 32 bit version works correctly on a 32 bit computer and the 64 bit version works correctly on a 64 bit computer.
Is this by design or am I misconfiguring in some way?
I have had this problem with both the Sapien V2 Host and the PowerShell Command line engine.
I am including the PowerShell script for reference. FYI, I am using the "$result =" pattern to cut down on output, though when I run the package on a remote computer, I am using the /s command line parameter.
Set-StrictMode -Version 2.0
$ErrorActionPreference = 'SilentlyContinue'
function Main () {
$result = Remove-ItemProperty -Path 'hklm:Software\Microsoft\Windows\CurrentVersion\WindowsUpdate' -Name 'SusClientID' -Force
$result = Remove-ItemProperty -Path 'hklm:Software\Microsoft\Windows\CurrentVersion\WindowsUpdate' -Name 'SusClientIDValidation' -Force
$result = Stop-Service wuauserv
$result = rm c:\windows\SoftwareDistribution -force -recurse
$result = Start-Service wuauserv
$result = wuauclt /detectnow
$successRegKeyPath = 'hklm:Software\company\Infrastructure'
$executionTime = (get-date -format 'yyyy-MM-dd hh:mm:ss')
$result = New-Item -Path $successRegKeyPath -Force
$result = New-ItemProperty $successRegKeyPath -Name "RepairWSUS_Execution" -Value $executionTime -PropertyType String
}
. Main
$ExitCode = 0