Quantcast
Channel: PowerShell App Deployment Toolkit
Viewing all 2341 articles
Browse latest View live

Commented Unassigned: Bug (typo) in Get-UserProfiles function [190]

$
0
0
In the Get-UserProfiles function (v3.6.0)
Line 3579 Registry value name DefaultUsersProfile should be DefaultUserProfile




Comments: Thanks, fixed the -ExpandProperty parameter as well

New Post: Show-InstallationPrompt Fails to display on specific conditions PSADTv3.5 & v3.6

$
0
0
The Show-InstallationPrompt Fails to display a MsgBox indicating that the App was successfully uninstalled, yet the log entries below seem to suggest that the Show-InstallationPrompt was processed successfuly.
[03-20-2015 18:58:18.015] [Uninstallation] [Show-InstallationPrompt] :: Displaying custom installation prompt with the non-default parameters: [-NoWait:$true -Icon "Information" -ButtonMiddleText "OK" -Message "The uninstallation of Wireshark 1.12.4 complete."]...
[03-20-2015 18:58:18.166] [Post-Uninstallation] [Exit-Script] :: @{InstallSource=; UninstallString="C:\Program Files\Wireshark\uninstall.exe"; Is64BitApplication=False; ProductCode=Wireshark; InstallLocation=C:\Program Files\Wireshark; Publisher=The Wireshark developer community, http://www.wireshark.org; InstallDate=; DisplayVersion=1.12.4; DisplayName=Wireshark 1.12.4 (64-bit)} Uninstallation completed with exit code [0].
[03-20-2015 18:58:18.214] [Post-Uninstallation] [Show-BalloonTip] :: Display balloon tip notification asyhchronously with message [Uninstallation complete.]
Development-Deploy-Application.ps1
Show-InstallationPrompt -Message "The uninstallation of $DisplayName $DisplayVersion complete." -ButtonMiddleText 'OK' -Icon Information -NoWait    
Moreover, Show-InstallationPrompt Fails to display a MsgBox indicating that the App was detected prior to making an installation attempt based on a custom parameter that calls a function to process detection logic to call Show-InstallationPrompt if the condition is met. This failure is as consistent as the one listed above.
AppDeployToolkitExtensions.ps1
Function IsInstallStatus {
    if ($InstallName -and $InstallVersion) {
        Show-InstallationPrompt -Message "$DisplayName $DisplayVersion is installed." -ButtonMiddleText 'OK' -Icon Information -NoWait; Write-Log "ErrorCode Return value is: 1638, proceeding."; Exit-Script -ExitCode 1638
    } else {
        Write-Log -Message "$DisplayName $DisplayVersion not installed, proceeding."
    }
}
Conversely, the Show-InstallationPrompt consistently passes when displaying a MsgBox indicating that the App was successfully installed as suggested by the log entries below.
[03-20-2015 19:04:29.759] [Post-Installation] [Show-InstallationPrompt] :: Displaying custom installation prompt with the non-default parameters: [-NoWait:$true -Icon "Information" -ButtonMiddleText "OK" -Message "The installation of Wireshark 1.12.4 complete."]...
[03-20-2015 19:04:29.900] [Post-Installation] [Exit-Script] :: Installation completed with exit code [0].
[03-20-2015 19:04:29.933] [Post-Installation] [Show-BalloonTip] :: Display balloon tip notification asyhchronously with message [Installation complete.]
Development-Deploy-Application.ps1
Show-InstallationPrompt -Message "The installation of $DisplayName $DisplayVersion complete." -ButtonMiddleText 'OK' -Icon Information -NoWait
Furthermore, Show-InstallationPrompt consistently passes when displaying a MsgBox indicating that the App was detected prior to making an uninstallation attempt based on a custom parameter that calls a function to process detection logic to call Show-InstallationPrompt if the condition is met as suggested by the log entries below.
[03-20-2015 19:01:41.873] [Pre-Uninstallation] [Show-InstallationPrompt] :: Displaying custom installation prompt with the non-default parameters: [-NoWait:$true -Icon "Information" -ButtonMiddleText "OK" -Message "Wireshark 1.12.4 not installed."]...
03-20-2015 19:01:41.930] [Pre-Uninstallation] :: ErrorCode Return value is: 1605, proceeding.
[03-20-2015 19:01:41.994] [Pre-Uninstallation] [Exit-Script] :: Uninstallation completed with exit code [1605].
[03-20-2015 19:01:42.027] [Pre-Uninstallation] [Show-BalloonTip] :: Display balloon tip notification asyhchronously with message [Uninstallation failed.]
AppDeployToolkitExtensions.ps1
Function IsUninstallStatus {
    if ($InstallName -and $InstallVersion) {
        Write-Log -Message "$DisplayName $DisplayVersion is installed, proceeding."
    } else {
        Show-InstallationPrompt -Message "$DisplayName $DisplayVersion not installed." -ButtonMiddleText 'OK' -Icon Information -NoWait; Write-Log "ErrorCode Return value is: 1605, proceeding."; Exit-Script -ExitCode 1605
    }
    
} 
I would have loved to include both the AppDeployToolkitExtensions.ps1 and the Development-Deploy-Application.ps1, but there doesn't appear a to be a method by which to upload the files for review. Once again I'm missing something. I am grateful for all of the expert assistance that I've retrieved with other problems. Thanks in advance for your expert advice.

Best Regards'

YVes

Commented Unassigned: PromptToSave switch hangs install if more than one instance of application requires save [183]

$
0
0
Original thread: https://psappdeploytoolkit.codeplex.com/discussions/586207

I notice this new switch in 3.6.0 and was testing using it. Notice if I have more than one instances of the application running and both required to be save, the Prompt to Save box will only appear for one of the instance. And after choose to save it, the PS script hang there and do nothing. After some time an error pop-up with Netframe error. Below is part of the details error.


Can someone comfirm on this? This is the command switch I had used.

Show-InstallationWelcome -CloseApps 'WINWORD' -AllowDeferCloseApps -DeferTimes 99 -CheckDiskSpace -RequiredDiskSpace 50 -PersistPrompt -MinimizeWindows $false -ForceCloseAppsCountdown 600 -PromptToSave

Thanks and regards
WaiYin

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

```
************** Exception Text **************
System.Management.Automation.RuntimeException: The script failed due to call depth overflow. ---> System.Management.Automation.ScriptCallDepthException: The script failed due to call depth overflow.
at System.Management.Automation.ExecutionContext.CheckStackDepth()
at System.Management.Automation.CommandProcessorBase.DoExecute()
at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate)
at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)
at <ScriptBlock>(Closure , FunctionContext )
--- End of inner exception stack trace ---
at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception)
at <ScriptBlock>(Closure , FunctionContext )
at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0 arg0)
at System.Management.Automation.ScriptBlock.InvokeWithPipeImpl(ScriptBlockClauseToInvoke clauseToInvoke, Boolean createLocalScope, Dictionary`2 functionsToDefine, List`1 variablesToDefine, ErrorHandlingBehavior errorHandlingBehavior, Object dollarUnder, Object input, Object scriptThis, Pipe outputPipe, InvocationInfo invocationInfo, Object[] args)
at System.Management.Automation.ScriptBlock.<>c__DisplayClassa.<InvokeWithPipe>b__8()
at System.Management.Automation.Runspaces.RunspaceBase.RunActionIfNoRunningPipelinesWithThreadCheck(Action action)
at System.Management.Automation.ScriptBlock.InvokeWithPipe(Boolean useLocalScope, Dictionary`2 functionsToDefine, List`1 variablesToDefine, ErrorHandlingBehavior errorHandlingBehavior, Object dollarUnder, Object input, Object scriptThis, Pipe outputPipe, InvocationInfo invocationInfo, Object[] args)
at System.Management.Automation.ScriptBlock.InvokeAsDelegateHelper(Object dollarUnder, Object dollarThis, Object[] args)
at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
----------------------------------------
Microsoft.PowerShell.ConsoleHost
Assembly Version: 3.0.0.0
Win32 Version: 6.3.9600.16384
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.PowerShell.ConsoleHost/v4.0_3.0.0.0__31bf3856ad364e35/Microsoft.PowerShell.ConsoleHost.dll
----------------------------------------
System
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34239 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Management.Automation
Assembly Version: 3.0.0.0
Win32 Version: 6.3.9600.17090
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Management.Automation/v4.0_3.0.0.0__31bf3856ad364e35/System.Management.Automation.dll
----------------------------------------
System.Numerics
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll
----------------------------------------
System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34230 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.DirectoryServices
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.DirectoryServices/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.DirectoryServices.dll
----------------------------------------
System.Management
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Management/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Management.dll
----------------------------------------
Microsoft.Management.Infrastructure
Assembly Version: 1.0.0.0
Win32 Version: 6.3.9600.16384
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.Management.Infrastructure/v4.0_1.0.0.0__31bf3856ad364e35/Microsoft.Management.Infrastructure.dll
----------------------------------------
Anonymously Hosted DynamicMethods Assembly
Assembly Version: 0.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_64/mscorlib/v4.0_4.0.0.0__b77a5c561934e089/mscorlib.dll
----------------------------------------
System.Configuration.Install
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.33440 built by: FX45W81RTMREL
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration.Install/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.Install.dll
----------------------------------------
System.Transactions
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_64/System.Transactions/v4.0_4.0.0.0__b77a5c561934e089/System.Transactions.dll
----------------------------------------
System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
Microsoft.PowerShell.Security
Assembly Version: 3.0.0.0
Win32 Version: 6.3.9600.16384
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.PowerShell.Security/v4.0_3.0.0.0__31bf3856ad364e35/Microsoft.PowerShell.Security.dll
----------------------------------------
System.Data
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_64/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
Microsoft.PowerShell.Commands.Management
Assembly Version: 3.0.0.0
Win32 Version: 6.3.9600.16384
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.PowerShell.Commands.Management/v4.0_3.0.0.0__31bf3856ad364e35/Microsoft.PowerShell.Commands.Management.dll
----------------------------------------
Microsoft.PowerShell.Commands.Utility
Assembly Version: 3.0.0.0
Win32 Version: 6.3.9600.16384
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.PowerShell.Commands.Utility/v4.0_3.0.0.0__31bf3856ad364e35/Microsoft.PowerShell.Commands.Utility.dll
----------------------------------------
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
```

Comments: Can you test this with MS Word? When i open 2 documents and edit them, there is only one Winword process running. And only one of the document get prompted to close.

Source code checked in, #020a6195330df45373a62ca900c5fa8039461691

$
0
0
Added default active username for -UserName parameter in Execute-ProcessAsUser Added default active username for -UserName parameter in Execute-ProcessAsUser

Source code checked in, #53103c8092291a0ef3a935d54dabeb56bddd8659

Commented Unassigned: Nit Pics for v3.60 [189]

$
0
0
Hi Mo,

I hope you don't get offended by these.
If you do, I'll stop.
Or If you want me to break these down as separate work items (e.g. the last one), I don't mind.

That_annoying_guy



__In Deploy-Application.ps1__
If AppDeployToolkitMain.ps1 does not exist, the script exits with ExitCode 1
Shouldn't this be like 60007 or something?


__If you DL from CodePlex's Sources section,__
\Testing\Deploy-Application.ps1 doesn't match Deploy-Application.ps1 of v3.60 release version


__In CodePlex's Sources section and in CodePlex's discussions forums, ServiceUI.exe is mentioned but is not part of the released version.__
Is ServiceUI.exe still experimental and that's why it's not in the regular Download or mentioned in the documentation?


__Execute-MSI exits if the MSI Is already Installed.__
This behaviour is not mentioned in Execute-MSI's .NOTES comments or in the PSADT manual. There is also no override switch.

__<Toolkit_CompressLogs> option__
In the PSADT manual, there is no mention of how <Toolkit_CompressLogs> in AppDeployToolkitConfig.xml overrides <MSI_LogPath> and how to fully use the <Toolkit_CompressLogs> option.
Would you like me to take a stab at it since I use it?


__Execute-process function should include this in its comments:__
"Not all programs play nicely with the hidden flag so if it's not working, then you should check the command line options for the exe you're running to see if there is a built in quiet option."
(source: Issue #187: Execute-process -hidden not so hidden)

__Test-ServiceExists service name is what?__
Test-ServiceExists function's comments (and Manual) should mention that the name it wants can be obtained from Get-Service or by using the properties screen of a service in Services.msc. A service name has no spaces or periods.
IOW: It is NOT a Display Name (e.g. "SMS Agent Host" or the name of the EXE (Ccmexec.exe).


__Should specify recommended range for custom ExitCodes in Deploy-Application.ps1__
If you need to cause ExitCodes Deploy-Application.ps1 and you use 70000+ numbers, initial though would be it's a function in AppDeployToolkitExtensions.ps1 that caused it. Maybe we should reserve 69000-70000 for custom ExitCodes in Deploy-Application.ps1.



__Should we have for more ExitCodes?__

For example if the $StubExePath for Set-ActiveSetup does not exist, it throws "Active Setup StubPath file [$ActiveSetupFileName] is missing." and the ExitCode is 60001

The problem is that currently *ALL* THROWs in AppDeployToolkitMain.ps1 end up causing ExitCode 60001.

Could/should we change some/all of the THROWs in PSADT to give a distinctive exitcode?
This way ExitCode 60001 really means "An error occurred in Deploy-Application.ps1. Check your script syntax use." as it's mentioned in the PSADT manual

For E.G. in Set-ActiveSetup function:
```
## Check if the $StubExePath file exists
If (-not (Test-Path -Path $StubExePath -PathType Leaf)) { Throw "Active Setup StubPath file [$ActiveSetupFileName] is missing." }
```

would become something like this:
```
## Check if the $StubExePath file exists
If (-not (Test-Path -Path $StubExePath -PathType Leaf)) {
Write-log "ERROR:Active Setup StubPath file [$ActiveSetupFileName] is missing."
Exit-Script -ExitCode 60010
}
```

Maybe reserve blocks of 10 ExitCodes per function, too.

What do you think? Worth it or too much work?

Comments: I added a -SkipMSIAlreadyInstalledCheck parameter to Execute-MSI function to allow ability to skip the check that determines if an MSI is already installed on the system. Also, if you have some comments you would like me to include on how to use Toolkit_CompressLogs options, please share and I will include it.

Edited Unassigned: Nit Pics for v3.60 [189]

$
0
0
Hi Mo,

I hope you don't get offended by these.
If you do, I'll stop.
Or If you want me to break these down as separate work items (e.g. the last one), I don't mind.

That_annoying_guy



__In Deploy-Application.ps1__
If AppDeployToolkitMain.ps1 does not exist, the script exits with ExitCode 1
Shouldn't this be like 60007 or something?


__If you DL from CodePlex's Sources section,__
\Testing\Deploy-Application.ps1 doesn't match Deploy-Application.ps1 of v3.60 release version


__In CodePlex's Sources section and in CodePlex's discussions forums, ServiceUI.exe is mentioned but is not part of the released version.__
Is ServiceUI.exe still experimental and that's why it's not in the regular Download or mentioned in the documentation?


__Execute-MSI exits if the MSI Is already Installed.__
This behaviour is not mentioned in Execute-MSI's .NOTES comments or in the PSADT manual. There is also no override switch.

__<Toolkit_CompressLogs> option__
In the PSADT manual, there is no mention of how <Toolkit_CompressLogs> in AppDeployToolkitConfig.xml overrides <MSI_LogPath> and how to fully use the <Toolkit_CompressLogs> option.
Would you like me to take a stab at it since I use it?


__Execute-process function should include this in its comments:__
"Not all programs play nicely with the hidden flag so if it's not working, then you should check the command line options for the exe you're running to see if there is a built in quiet option."
(source: Issue #187: Execute-process -hidden not so hidden)

__Test-ServiceExists service name is what?__
Test-ServiceExists function's comments (and Manual) should mention that the name it wants can be obtained from Get-Service or by using the properties screen of a service in Services.msc. A service name has no spaces or periods.
IOW: It is NOT a Display Name (e.g. "SMS Agent Host" or the name of the EXE (Ccmexec.exe).


__Should specify recommended range for custom ExitCodes in Deploy-Application.ps1__
If you need to cause ExitCodes Deploy-Application.ps1 and you use 70000+ numbers, initial though would be it's a function in AppDeployToolkitExtensions.ps1 that caused it. Maybe we should reserve 69000-70000 for custom ExitCodes in Deploy-Application.ps1.



__Should we have for more ExitCodes?__

For example if the $StubExePath for Set-ActiveSetup does not exist, it throws "Active Setup StubPath file [$ActiveSetupFileName] is missing." and the ExitCode is 60001

The problem is that currently *ALL* THROWs in AppDeployToolkitMain.ps1 end up causing ExitCode 60001.

Could/should we change some/all of the THROWs in PSADT to give a distinctive exitcode?
This way ExitCode 60001 really means "An error occurred in Deploy-Application.ps1. Check your script syntax use." as it's mentioned in the PSADT manual

For E.G. in Set-ActiveSetup function:
```
## Check if the $StubExePath file exists
If (-not (Test-Path -Path $StubExePath -PathType Leaf)) { Throw "Active Setup StubPath file [$ActiveSetupFileName] is missing." }
```

would become something like this:
```
## Check if the $StubExePath file exists
If (-not (Test-Path -Path $StubExePath -PathType Leaf)) {
Write-log "ERROR:Active Setup StubPath file [$ActiveSetupFileName] is missing."
Exit-Script -ExitCode 60010
}
```

Maybe reserve blocks of 10 ExitCodes per function, too.

What do you think? Worth it or too much work?

Source code checked in, #015ee10ac961542ddd720a91cdc0bfafc5afbb19

$
0
0
Fixed issue in Show-InstallationWelcome Fixed issue in Show-InstallationWelcome to avoid error if the Description field of a hung process could not be accessed

New Post: Error while checking running applications (3.6.0)

$
0
0
The failure is occurring when we try to use Select-Object to expand the value of the Description field for the process. My guess is that when a process gets into a hung state, windows is not able to access the Description field of the process anymore and when we try to access it and expand the value, we end up with an error.

I've added a check to make sure the Description filed of a process is not $null before we try to expand that value by adding the following bit of code: Where-Object { $null -ne $_.Description }

You can find the latest 3.6.1 beta under the "Source Code" tab of this site for testing purposes. We will probably have a final release out some time this week.

New Post: Progress bar rather than spinning icon?

$
0
0
Hi Guys

Is there any way to customise PADT deployments to show a progress bar instead. I was considering using Write-Progress. Not sure if this would work or where to put it if I am honest.

Any chance this is possible?

Thanks in advance
NN

New Post: SCCM 2012 settings

$
0
0
What is the commandline you are using. Did you try: Deploy-Application.EXE -DeploymentType Install
This works for me.

Make sure your packages works locally first by running the Deploy-Application.EXE.

Thanks
NN

Edited Unassigned: PromptToSave switch hangs install if a single process has more than one file open which requires a save (Office 2010 and higher apps behave this way) [183]

$
0
0
Original thread: https://psappdeploytoolkit.codeplex.com/discussions/586207

I notice this new switch in 3.6.0 and was testing using it. Notice if I have more than one instances of the application running and both required to be save, the Prompt to Save box will only appear for one of the instance. And after choose to save it, the PS script hang there and do nothing. After some time an error pop-up with Netframe error. Below is part of the details error.


Can someone comfirm on this? This is the command switch I had used.

Show-InstallationWelcome -CloseApps 'WINWORD' -AllowDeferCloseApps -DeferTimes 99 -CheckDiskSpace -RequiredDiskSpace 50 -PersistPrompt -MinimizeWindows $false -ForceCloseAppsCountdown 600 -PromptToSave

Thanks and regards
WaiYin

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

```
************** Exception Text **************
System.Management.Automation.RuntimeException: The script failed due to call depth overflow. ---> System.Management.Automation.ScriptCallDepthException: The script failed due to call depth overflow.
at System.Management.Automation.ExecutionContext.CheckStackDepth()
at System.Management.Automation.CommandProcessorBase.DoExecute()
at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate)
at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)
at <ScriptBlock>(Closure , FunctionContext )
--- End of inner exception stack trace ---
at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception)
at <ScriptBlock>(Closure , FunctionContext )
at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0 arg0)
at System.Management.Automation.ScriptBlock.InvokeWithPipeImpl(ScriptBlockClauseToInvoke clauseToInvoke, Boolean createLocalScope, Dictionary`2 functionsToDefine, List`1 variablesToDefine, ErrorHandlingBehavior errorHandlingBehavior, Object dollarUnder, Object input, Object scriptThis, Pipe outputPipe, InvocationInfo invocationInfo, Object[] args)
at System.Management.Automation.ScriptBlock.<>c__DisplayClassa.<InvokeWithPipe>b__8()
at System.Management.Automation.Runspaces.RunspaceBase.RunActionIfNoRunningPipelinesWithThreadCheck(Action action)
at System.Management.Automation.ScriptBlock.InvokeWithPipe(Boolean useLocalScope, Dictionary`2 functionsToDefine, List`1 variablesToDefine, ErrorHandlingBehavior errorHandlingBehavior, Object dollarUnder, Object input, Object scriptThis, Pipe outputPipe, InvocationInfo invocationInfo, Object[] args)
at System.Management.Automation.ScriptBlock.InvokeAsDelegateHelper(Object dollarUnder, Object dollarThis, Object[] args)
at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
----------------------------------------
Microsoft.PowerShell.ConsoleHost
Assembly Version: 3.0.0.0
Win32 Version: 6.3.9600.16384
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.PowerShell.ConsoleHost/v4.0_3.0.0.0__31bf3856ad364e35/Microsoft.PowerShell.ConsoleHost.dll
----------------------------------------
System
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34239 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Management.Automation
Assembly Version: 3.0.0.0
Win32 Version: 6.3.9600.17090
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Management.Automation/v4.0_3.0.0.0__31bf3856ad364e35/System.Management.Automation.dll
----------------------------------------
System.Numerics
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll
----------------------------------------
System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34230 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.DirectoryServices
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.DirectoryServices/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.DirectoryServices.dll
----------------------------------------
System.Management
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Management/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Management.dll
----------------------------------------
Microsoft.Management.Infrastructure
Assembly Version: 1.0.0.0
Win32 Version: 6.3.9600.16384
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.Management.Infrastructure/v4.0_1.0.0.0__31bf3856ad364e35/Microsoft.Management.Infrastructure.dll
----------------------------------------
Anonymously Hosted DynamicMethods Assembly
Assembly Version: 0.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_64/mscorlib/v4.0_4.0.0.0__b77a5c561934e089/mscorlib.dll
----------------------------------------
System.Configuration.Install
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.33440 built by: FX45W81RTMREL
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration.Install/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.Install.dll
----------------------------------------
System.Transactions
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_64/System.Transactions/v4.0_4.0.0.0__b77a5c561934e089/System.Transactions.dll
----------------------------------------
System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
Microsoft.PowerShell.Security
Assembly Version: 3.0.0.0
Win32 Version: 6.3.9600.16384
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.PowerShell.Security/v4.0_3.0.0.0__31bf3856ad364e35/Microsoft.PowerShell.Security.dll
----------------------------------------
System.Data
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_64/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
Microsoft.PowerShell.Commands.Management
Assembly Version: 3.0.0.0
Win32 Version: 6.3.9600.16384
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.PowerShell.Commands.Management/v4.0_3.0.0.0__31bf3856ad364e35/Microsoft.PowerShell.Commands.Management.dll
----------------------------------------
Microsoft.PowerShell.Commands.Utility
Assembly Version: 3.0.0.0
Win32 Version: 6.3.9600.16384
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.PowerShell.Commands.Utility/v4.0_3.0.0.0__31bf3856ad364e35/Microsoft.PowerShell.Commands.Utility.dll
----------------------------------------
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
```

Commented Unassigned: Nit Pics for v3.60 [189]

$
0
0
Hi Mo,

I hope you don't get offended by these.
If you do, I'll stop.
Or If you want me to break these down as separate work items (e.g. the last one), I don't mind.

That_annoying_guy



__In Deploy-Application.ps1__
If AppDeployToolkitMain.ps1 does not exist, the script exits with ExitCode 1
Shouldn't this be like 60007 or something?


__If you DL from CodePlex's Sources section,__
\Testing\Deploy-Application.ps1 doesn't match Deploy-Application.ps1 of v3.60 release version


__In CodePlex's Sources section and in CodePlex's discussions forums, ServiceUI.exe is mentioned but is not part of the released version.__
Is ServiceUI.exe still experimental and that's why it's not in the regular Download or mentioned in the documentation?


__Execute-MSI exits if the MSI Is already Installed.__
This behaviour is not mentioned in Execute-MSI's .NOTES comments or in the PSADT manual. There is also no override switch.

__<Toolkit_CompressLogs> option__
In the PSADT manual, there is no mention of how <Toolkit_CompressLogs> in AppDeployToolkitConfig.xml overrides <MSI_LogPath> and how to fully use the <Toolkit_CompressLogs> option.
Would you like me to take a stab at it since I use it?


__Execute-process function should include this in its comments:__
"Not all programs play nicely with the hidden flag so if it's not working, then you should check the command line options for the exe you're running to see if there is a built in quiet option."
(source: Issue #187: Execute-process -hidden not so hidden)

__Test-ServiceExists service name is what?__
Test-ServiceExists function's comments (and Manual) should mention that the name it wants can be obtained from Get-Service or by using the properties screen of a service in Services.msc. A service name has no spaces or periods.
IOW: It is NOT a Display Name (e.g. "SMS Agent Host" or the name of the EXE (Ccmexec.exe).


__Should specify recommended range for custom ExitCodes in Deploy-Application.ps1__
If you need to cause ExitCodes Deploy-Application.ps1 and you use 70000+ numbers, initial though would be it's a function in AppDeployToolkitExtensions.ps1 that caused it. Maybe we should reserve 69000-70000 for custom ExitCodes in Deploy-Application.ps1.



__Should we have for more ExitCodes?__

For example if the $StubExePath for Set-ActiveSetup does not exist, it throws "Active Setup StubPath file [$ActiveSetupFileName] is missing." and the ExitCode is 60001

The problem is that currently *ALL* THROWs in AppDeployToolkitMain.ps1 end up causing ExitCode 60001.

Could/should we change some/all of the THROWs in PSADT to give a distinctive exitcode?
This way ExitCode 60001 really means "An error occurred in Deploy-Application.ps1. Check your script syntax use." as it's mentioned in the PSADT manual

For E.G. in Set-ActiveSetup function:
```
## Check if the $StubExePath file exists
If (-not (Test-Path -Path $StubExePath -PathType Leaf)) { Throw "Active Setup StubPath file [$ActiveSetupFileName] is missing." }
```

would become something like this:
```
## Check if the $StubExePath file exists
If (-not (Test-Path -Path $StubExePath -PathType Leaf)) {
Write-log "ERROR:Active Setup StubPath file [$ActiveSetupFileName] is missing."
Exit-Script -ExitCode 60010
}
```

Maybe reserve blocks of 10 ExitCodes per function, too.

What do you think? Worth it or too much work?

Comments: I'm fine with that. Since there is no way to upload binary to CODEplex, I'll post it in here as plain-ish text when I'll have it done. That_annoying_guy

Edited Unassigned: PromptToSave switch hangs install if a single process has more than one file open which requires a save (Office 2007 and higher apps behave this way) [183]

$
0
0
Original thread: https://psappdeploytoolkit.codeplex.com/discussions/586207

I notice this new switch in 3.6.0 and was testing using it. Notice if I have more than one instances of the application running and both required to be save, the Prompt to Save box will only appear for one of the instance. And after choose to save it, the PS script hang there and do nothing. After some time an error pop-up with Netframe error. Below is part of the details error.


Can someone comfirm on this? This is the command switch I had used.

Show-InstallationWelcome -CloseApps 'WINWORD' -AllowDeferCloseApps -DeferTimes 99 -CheckDiskSpace -RequiredDiskSpace 50 -PersistPrompt -MinimizeWindows $false -ForceCloseAppsCountdown 600 -PromptToSave

Thanks and regards
WaiYin

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

```
************** Exception Text **************
System.Management.Automation.RuntimeException: The script failed due to call depth overflow. ---> System.Management.Automation.ScriptCallDepthException: The script failed due to call depth overflow.
at System.Management.Automation.ExecutionContext.CheckStackDepth()
at System.Management.Automation.CommandProcessorBase.DoExecute()
at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate)
at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)
at <ScriptBlock>(Closure , FunctionContext )
--- End of inner exception stack trace ---
at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception)
at <ScriptBlock>(Closure , FunctionContext )
at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0 arg0)
at System.Management.Automation.ScriptBlock.InvokeWithPipeImpl(ScriptBlockClauseToInvoke clauseToInvoke, Boolean createLocalScope, Dictionary`2 functionsToDefine, List`1 variablesToDefine, ErrorHandlingBehavior errorHandlingBehavior, Object dollarUnder, Object input, Object scriptThis, Pipe outputPipe, InvocationInfo invocationInfo, Object[] args)
at System.Management.Automation.ScriptBlock.<>c__DisplayClassa.<InvokeWithPipe>b__8()
at System.Management.Automation.Runspaces.RunspaceBase.RunActionIfNoRunningPipelinesWithThreadCheck(Action action)
at System.Management.Automation.ScriptBlock.InvokeWithPipe(Boolean useLocalScope, Dictionary`2 functionsToDefine, List`1 variablesToDefine, ErrorHandlingBehavior errorHandlingBehavior, Object dollarUnder, Object input, Object scriptThis, Pipe outputPipe, InvocationInfo invocationInfo, Object[] args)
at System.Management.Automation.ScriptBlock.InvokeAsDelegateHelper(Object dollarUnder, Object dollarThis, Object[] args)
at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
----------------------------------------
Microsoft.PowerShell.ConsoleHost
Assembly Version: 3.0.0.0
Win32 Version: 6.3.9600.16384
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.PowerShell.ConsoleHost/v4.0_3.0.0.0__31bf3856ad364e35/Microsoft.PowerShell.ConsoleHost.dll
----------------------------------------
System
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34239 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Management.Automation
Assembly Version: 3.0.0.0
Win32 Version: 6.3.9600.17090
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Management.Automation/v4.0_3.0.0.0__31bf3856ad364e35/System.Management.Automation.dll
----------------------------------------
System.Numerics
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll
----------------------------------------
System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34230 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.DirectoryServices
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.DirectoryServices/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.DirectoryServices.dll
----------------------------------------
System.Management
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Management/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Management.dll
----------------------------------------
Microsoft.Management.Infrastructure
Assembly Version: 1.0.0.0
Win32 Version: 6.3.9600.16384
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.Management.Infrastructure/v4.0_1.0.0.0__31bf3856ad364e35/Microsoft.Management.Infrastructure.dll
----------------------------------------
Anonymously Hosted DynamicMethods Assembly
Assembly Version: 0.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_64/mscorlib/v4.0_4.0.0.0__b77a5c561934e089/mscorlib.dll
----------------------------------------
System.Configuration.Install
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.33440 built by: FX45W81RTMREL
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration.Install/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.Install.dll
----------------------------------------
System.Transactions
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_64/System.Transactions/v4.0_4.0.0.0__b77a5c561934e089/System.Transactions.dll
----------------------------------------
System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
Microsoft.PowerShell.Security
Assembly Version: 3.0.0.0
Win32 Version: 6.3.9600.16384
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.PowerShell.Security/v4.0_3.0.0.0__31bf3856ad364e35/Microsoft.PowerShell.Security.dll
----------------------------------------
System.Data
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_64/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
Microsoft.PowerShell.Commands.Management
Assembly Version: 3.0.0.0
Win32 Version: 6.3.9600.16384
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.PowerShell.Commands.Management/v4.0_3.0.0.0__31bf3856ad364e35/Microsoft.PowerShell.Commands.Management.dll
----------------------------------------
Microsoft.PowerShell.Commands.Utility
Assembly Version: 3.0.0.0
Win32 Version: 6.3.9600.16384
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.PowerShell.Commands.Utility/v4.0_3.0.0.0__31bf3856ad364e35/Microsoft.PowerShell.Commands.Utility.dll
----------------------------------------
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
```

New Post: Progress bar rather than spinning icon?

$
0
0
NakedNuts wrote:
Hi Guys

Is there any way to customise PADT deployments to show a progress bar instead. I was considering using Write-Progress. Not sure if this would work or where to put it if I am honest.

Any chance this is possible?

Thanks in advance
NN
A marquee style progress indicator would be nice!

Yves.

Commented Unassigned: PromptToSave switch hangs install if a single process has more than one file open which requires a save (Office 2007 and higher apps behave this way) [183]

$
0
0
Original thread: https://psappdeploytoolkit.codeplex.com/discussions/586207

I notice this new switch in 3.6.0 and was testing using it. Notice if I have more than one instances of the application running and both required to be save, the Prompt to Save box will only appear for one of the instance. And after choose to save it, the PS script hang there and do nothing. After some time an error pop-up with Netframe error. Below is part of the details error.


Can someone comfirm on this? This is the command switch I had used.

Show-InstallationWelcome -CloseApps 'WINWORD' -AllowDeferCloseApps -DeferTimes 99 -CheckDiskSpace -RequiredDiskSpace 50 -PersistPrompt -MinimizeWindows $false -ForceCloseAppsCountdown 600 -PromptToSave

Thanks and regards
WaiYin

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

```
************** Exception Text **************
System.Management.Automation.RuntimeException: The script failed due to call depth overflow. ---> System.Management.Automation.ScriptCallDepthException: The script failed due to call depth overflow.
at System.Management.Automation.ExecutionContext.CheckStackDepth()
at System.Management.Automation.CommandProcessorBase.DoExecute()
at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate)
at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)
at <ScriptBlock>(Closure , FunctionContext )
--- End of inner exception stack trace ---
at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception)
at <ScriptBlock>(Closure , FunctionContext )
at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0 arg0)
at System.Management.Automation.ScriptBlock.InvokeWithPipeImpl(ScriptBlockClauseToInvoke clauseToInvoke, Boolean createLocalScope, Dictionary`2 functionsToDefine, List`1 variablesToDefine, ErrorHandlingBehavior errorHandlingBehavior, Object dollarUnder, Object input, Object scriptThis, Pipe outputPipe, InvocationInfo invocationInfo, Object[] args)
at System.Management.Automation.ScriptBlock.<>c__DisplayClassa.<InvokeWithPipe>b__8()
at System.Management.Automation.Runspaces.RunspaceBase.RunActionIfNoRunningPipelinesWithThreadCheck(Action action)
at System.Management.Automation.ScriptBlock.InvokeWithPipe(Boolean useLocalScope, Dictionary`2 functionsToDefine, List`1 variablesToDefine, ErrorHandlingBehavior errorHandlingBehavior, Object dollarUnder, Object input, Object scriptThis, Pipe outputPipe, InvocationInfo invocationInfo, Object[] args)
at System.Management.Automation.ScriptBlock.InvokeAsDelegateHelper(Object dollarUnder, Object dollarThis, Object[] args)
at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
----------------------------------------
Microsoft.PowerShell.ConsoleHost
Assembly Version: 3.0.0.0
Win32 Version: 6.3.9600.16384
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.PowerShell.ConsoleHost/v4.0_3.0.0.0__31bf3856ad364e35/Microsoft.PowerShell.ConsoleHost.dll
----------------------------------------
System
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34239 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Management.Automation
Assembly Version: 3.0.0.0
Win32 Version: 6.3.9600.17090
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Management.Automation/v4.0_3.0.0.0__31bf3856ad364e35/System.Management.Automation.dll
----------------------------------------
System.Numerics
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll
----------------------------------------
System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34230 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.DirectoryServices
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.DirectoryServices/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.DirectoryServices.dll
----------------------------------------
System.Management
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Management/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Management.dll
----------------------------------------
Microsoft.Management.Infrastructure
Assembly Version: 1.0.0.0
Win32 Version: 6.3.9600.16384
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.Management.Infrastructure/v4.0_1.0.0.0__31bf3856ad364e35/Microsoft.Management.Infrastructure.dll
----------------------------------------
Anonymously Hosted DynamicMethods Assembly
Assembly Version: 0.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_64/mscorlib/v4.0_4.0.0.0__b77a5c561934e089/mscorlib.dll
----------------------------------------
System.Configuration.Install
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.33440 built by: FX45W81RTMREL
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration.Install/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.Install.dll
----------------------------------------
System.Transactions
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_64/System.Transactions/v4.0_4.0.0.0__b77a5c561934e089/System.Transactions.dll
----------------------------------------
System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
Microsoft.PowerShell.Security
Assembly Version: 3.0.0.0
Win32 Version: 6.3.9600.16384
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.PowerShell.Security/v4.0_3.0.0.0__31bf3856ad364e35/Microsoft.PowerShell.Security.dll
----------------------------------------
System.Data
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_64/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
Microsoft.PowerShell.Commands.Management
Assembly Version: 3.0.0.0
Win32 Version: 6.3.9600.16384
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.PowerShell.Commands.Management/v4.0_3.0.0.0__31bf3856ad364e35/Microsoft.PowerShell.Commands.Management.dll
----------------------------------------
Microsoft.PowerShell.Commands.Utility
Assembly Version: 3.0.0.0
Win32 Version: 6.3.9600.16384
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.PowerShell.Commands.Utility/v4.0_3.0.0.0__31bf3856ad364e35/Microsoft.PowerShell.Commands.Utility.dll
----------------------------------------
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
```

Comments: @superz202 Is this option selected or not on the systems where you notice this issue? File > Options > Advanced > Display > Show all windows in the Taskbar

Commented Unassigned: PromptToSave switch hangs install if a single process has more than one file open which requires a save (Office 2007 and higher apps behave this way) [183]

$
0
0
Original thread: https://psappdeploytoolkit.codeplex.com/discussions/586207

I notice this new switch in 3.6.0 and was testing using it. Notice if I have more than one instances of the application running and both required to be save, the Prompt to Save box will only appear for one of the instance. And after choose to save it, the PS script hang there and do nothing. After some time an error pop-up with Netframe error. Below is part of the details error.


Can someone comfirm on this? This is the command switch I had used.

Show-InstallationWelcome -CloseApps 'WINWORD' -AllowDeferCloseApps -DeferTimes 99 -CheckDiskSpace -RequiredDiskSpace 50 -PersistPrompt -MinimizeWindows $false -ForceCloseAppsCountdown 600 -PromptToSave

Thanks and regards
WaiYin

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

```
************** Exception Text **************
System.Management.Automation.RuntimeException: The script failed due to call depth overflow. ---> System.Management.Automation.ScriptCallDepthException: The script failed due to call depth overflow.
at System.Management.Automation.ExecutionContext.CheckStackDepth()
at System.Management.Automation.CommandProcessorBase.DoExecute()
at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate)
at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)
at <ScriptBlock>(Closure , FunctionContext )
--- End of inner exception stack trace ---
at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception)
at <ScriptBlock>(Closure , FunctionContext )
at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0 arg0)
at System.Management.Automation.ScriptBlock.InvokeWithPipeImpl(ScriptBlockClauseToInvoke clauseToInvoke, Boolean createLocalScope, Dictionary`2 functionsToDefine, List`1 variablesToDefine, ErrorHandlingBehavior errorHandlingBehavior, Object dollarUnder, Object input, Object scriptThis, Pipe outputPipe, InvocationInfo invocationInfo, Object[] args)
at System.Management.Automation.ScriptBlock.<>c__DisplayClassa.<InvokeWithPipe>b__8()
at System.Management.Automation.Runspaces.RunspaceBase.RunActionIfNoRunningPipelinesWithThreadCheck(Action action)
at System.Management.Automation.ScriptBlock.InvokeWithPipe(Boolean useLocalScope, Dictionary`2 functionsToDefine, List`1 variablesToDefine, ErrorHandlingBehavior errorHandlingBehavior, Object dollarUnder, Object input, Object scriptThis, Pipe outputPipe, InvocationInfo invocationInfo, Object[] args)
at System.Management.Automation.ScriptBlock.InvokeAsDelegateHelper(Object dollarUnder, Object dollarThis, Object[] args)
at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
----------------------------------------
Microsoft.PowerShell.ConsoleHost
Assembly Version: 3.0.0.0
Win32 Version: 6.3.9600.16384
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.PowerShell.ConsoleHost/v4.0_3.0.0.0__31bf3856ad364e35/Microsoft.PowerShell.ConsoleHost.dll
----------------------------------------
System
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34239 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Management.Automation
Assembly Version: 3.0.0.0
Win32 Version: 6.3.9600.17090
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Management.Automation/v4.0_3.0.0.0__31bf3856ad364e35/System.Management.Automation.dll
----------------------------------------
System.Numerics
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll
----------------------------------------
System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34230 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.DirectoryServices
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.DirectoryServices/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.DirectoryServices.dll
----------------------------------------
System.Management
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Management/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Management.dll
----------------------------------------
Microsoft.Management.Infrastructure
Assembly Version: 1.0.0.0
Win32 Version: 6.3.9600.16384
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.Management.Infrastructure/v4.0_1.0.0.0__31bf3856ad364e35/Microsoft.Management.Infrastructure.dll
----------------------------------------
Anonymously Hosted DynamicMethods Assembly
Assembly Version: 0.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_64/mscorlib/v4.0_4.0.0.0__b77a5c561934e089/mscorlib.dll
----------------------------------------
System.Configuration.Install
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.33440 built by: FX45W81RTMREL
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration.Install/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.Install.dll
----------------------------------------
System.Transactions
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_64/System.Transactions/v4.0_4.0.0.0__b77a5c561934e089/System.Transactions.dll
----------------------------------------
System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
Microsoft.PowerShell.Security
Assembly Version: 3.0.0.0
Win32 Version: 6.3.9600.16384
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.PowerShell.Security/v4.0_3.0.0.0__31bf3856ad364e35/Microsoft.PowerShell.Security.dll
----------------------------------------
System.Data
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_64/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
Microsoft.PowerShell.Commands.Management
Assembly Version: 3.0.0.0
Win32 Version: 6.3.9600.16384
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.PowerShell.Commands.Management/v4.0_3.0.0.0__31bf3856ad364e35/Microsoft.PowerShell.Commands.Management.dll
----------------------------------------
Microsoft.PowerShell.Commands.Utility
Assembly Version: 3.0.0.0
Win32 Version: 6.3.9600.16384
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.PowerShell.Commands.Utility/v4.0_3.0.0.0__31bf3856ad364e35/Microsoft.PowerShell.Commands.Utility.dll
----------------------------------------
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
```

Comments: Also, do you have the same issue with Excel or PowerPoint documents? Or is it just with Word?

Commented Unassigned: Nit Pics for v3.60 [189]

$
0
0
Hi Mo,

I hope you don't get offended by these.
If you do, I'll stop.
Or If you want me to break these down as separate work items (e.g. the last one), I don't mind.

That_annoying_guy



__In Deploy-Application.ps1__
If AppDeployToolkitMain.ps1 does not exist, the script exits with ExitCode 1
Shouldn't this be like 60007 or something?


__If you DL from CodePlex's Sources section,__
\Testing\Deploy-Application.ps1 doesn't match Deploy-Application.ps1 of v3.60 release version


__In CodePlex's Sources section and in CodePlex's discussions forums, ServiceUI.exe is mentioned but is not part of the released version.__
Is ServiceUI.exe still experimental and that's why it's not in the regular Download or mentioned in the documentation?


__Execute-MSI exits if the MSI Is already Installed.__
This behaviour is not mentioned in Execute-MSI's .NOTES comments or in the PSADT manual. There is also no override switch.

__<Toolkit_CompressLogs> option__
In the PSADT manual, there is no mention of how <Toolkit_CompressLogs> in AppDeployToolkitConfig.xml overrides <MSI_LogPath> and how to fully use the <Toolkit_CompressLogs> option.
Would you like me to take a stab at it since I use it?


__Execute-process function should include this in its comments:__
"Not all programs play nicely with the hidden flag so if it's not working, then you should check the command line options for the exe you're running to see if there is a built in quiet option."
(source: Issue #187: Execute-process -hidden not so hidden)

__Test-ServiceExists service name is what?__
Test-ServiceExists function's comments (and Manual) should mention that the name it wants can be obtained from Get-Service or by using the properties screen of a service in Services.msc. A service name has no spaces or periods.
IOW: It is NOT a Display Name (e.g. "SMS Agent Host" or the name of the EXE (Ccmexec.exe).


__Should specify recommended range for custom ExitCodes in Deploy-Application.ps1__
If you need to cause ExitCodes Deploy-Application.ps1 and you use 70000+ numbers, initial though would be it's a function in AppDeployToolkitExtensions.ps1 that caused it. Maybe we should reserve 69000-70000 for custom ExitCodes in Deploy-Application.ps1.



__Should we have for more ExitCodes?__

For example if the $StubExePath for Set-ActiveSetup does not exist, it throws "Active Setup StubPath file [$ActiveSetupFileName] is missing." and the ExitCode is 60001

The problem is that currently *ALL* THROWs in AppDeployToolkitMain.ps1 end up causing ExitCode 60001.

Could/should we change some/all of the THROWs in PSADT to give a distinctive exitcode?
This way ExitCode 60001 really means "An error occurred in Deploy-Application.ps1. Check your script syntax use." as it's mentioned in the PSADT manual

For E.G. in Set-ActiveSetup function:
```
## Check if the $StubExePath file exists
If (-not (Test-Path -Path $StubExePath -PathType Leaf)) { Throw "Active Setup StubPath file [$ActiveSetupFileName] is missing." }
```

would become something like this:
```
## Check if the $StubExePath file exists
If (-not (Test-Path -Path $StubExePath -PathType Leaf)) {
Write-log "ERROR:Active Setup StubPath file [$ActiveSetupFileName] is missing."
Exit-Script -ExitCode 60010
}
```

Maybe reserve blocks of 10 ExitCodes per function, too.

What do you think? Worth it or too much work?

Comments: 5 Toolkit Usage Customizing the Toolkit One of the Toolkit Options in AppDeployToolkitConfig.xml file is CompressLogs. This will create the concept of a temporary logging FOLDER where you can throw all the log files you want into it and it will become one ZIP file regardless of a success or failure. To enable it, edit AppDeployToolkitConfig.xml to change: <Toolkit_CompressLogs>False</Toolkit_CompressLogs> To <Toolkit_CompressLogs>True</Toolkit_CompressLogs> When set to True, the following happens: • Both toolkit and MSI logs are temporally placed in $envTemp\$installName which gets cleaned up at the end of the install • At the end of the install / uninstall, the logs are compressed to a new zip file which is placed in the LogFolder location in the config file • The Zip file name indicates whether it is an Install / Uninstall and has the timestamp in the filename so previous logs do not get overwritten • If your package creates other log files, you can send them to the temporary logging FOLDER at $envTemp\$installName.

Commented Unassigned: Install-SCCMSoftwareUpdates only for SCCM2012? [185]

$
0
0
We have SCCM2007 (W/ all the patches AFAIK)

In my Deploy-Application.ps1, I have:
```
#Make sure SCCM client is installed and running or else Install-SCCMSoftwareUpdates blows up
If (Test-ServiceExists -Name "ccmexec") {
If ($(Get-Service -Name ccmexec).status -eq "Running") {
Install-SCCMSoftwareUpdates -ContinueOnError $false
} Else {
Write-Log "ERROR: ccmexec service not Running"
Exit-Script -ExitCode 69001
}
} Else {
Write-Log "ERROR: Missing ccmexec service. Is the SCCM client installed?"
Exit-Script -ExitCode 69000
}
Read-Host "Press Enter" #To capture Get-WmiObject error
```

And I get the following in the console:
---------- Snip ---------------------
[03-17-2015 14:02:15.204] [Initialization] [TK] :: Session 0 not detected.
[03-17-2015 14:02:15.219] [Initialization] [TK] :: Installation is running in [NonInteractive] mode.
[03-17-2015 14:02:15.235] [Initialization] [TK] :: Deployment type is [Installation]
[03-17-2015 14:02:15.297] [Pre-Installation] :: Uninstall previous version(s), if needed.
[03-17-2015 14:02:15.313] [Installation] :: INFO: ScriptDirectory is \\Workstation\d$\Projects\SCCMPullWSUSupdates

[03-17-2015 14:02:15.328] [Installation] :: INFO: Performing installation tasks
[03-17-2015 14:02:15.765] [Installation] [Test-ServiceExists] :: Service [ccmexec] exists
[03-17-2015 14:02:15.812] [Installation] [Install-SCCMSoftwareUpdates] :: Trigger SCCM client scan for Software Updates.
..
[03-17-2015 14:02:15.843] [Installation] [Invoke-SCCMTask] :: Invoke SCCM Schedule Task ID [SoftwareUpdatesScan]...
[03-17-2015 14:02:15.984] [Installation] [Install-SCCMSoftwareUpdates] :: The SCCM client scan for Software Updates has
been triggered. The script is suspended for [180] seconds to let the update scan finish.
__Get-WmiObject : Invalid namespace__
__At \\Workstation\d$\Projects\SCCMPullWSUSupdates\AppDeployToolkit\AppDeployToolkitMain.ps1:7543 char:77__
__[System.Management.ManagementObject[]]$CMMissingUpdates = @(Get-WmiObject <<<< -Namespace 'ROOT\CCM\ClientSDK' -Query "SELECT * FROM CCM_SoftwareUpdate WHERE ComplianceState = '0'")__
__CategoryInfo : InvalidOperation: (:) [Get-WmiObject], ManagementException__
__FullyQualifiedErrorId : GetWMIManagementException,Microsoft.PowerShell.Commands.GetWmiObjectCommand__
[03-17-2015 14:05:16.087] [Installation] [Install-SCCMSoftwareUpdates] :: There are no missing updates.

TL;DR; Summary
* Environment: Windows 7 SP1 English on a VM
* The 'ROOT\CCM\ClientSDK' namespace does not exist on a machine with the SCCM2007 Client
* The error message in BOLD above does not get logged but shows in the console.
* When this error happens, Exitcode is 0
* Install-SCCMSoftwareUpdates and Invoke-SCCMTask assume CcmExec service is always installed and running


Regardless, I might still have a way to make this work in SCCM2007.


Comments: I tried the new version and it seems to detect SCCM2007 just file. It just looks scary if you thought it would work. I though the script would fail sooner. __CAVEAT the line numbers will NOT match does to my in-house mods.__ ``` [string]$appDeployMainScriptDate = '03/19/2015' .... [Installation] :: INFO: Performing installation tasks 23/03/2015 3:45:21 PM 0 (0x0000) [Installation] :: Service [ccmexec] exists Test-ServiceExists 23/03/2015 3:45:22 PM 4024 (0x0FB8) [Installation] :: Scan for and install pending SCCM software updates. Install-SCCMSoftwareUpdates 23/03/2015 3:45:22 PM 4024 (0x0FB8) [Installation] :: Check to see if SCCM Client service [ccmexec] is installed and running. Install-SCCMSoftwareUpdates 23/03/2015 3:45:22 PM 4024 (0x0FB8) [Installation] :: Service [ccmexec] exists Test-ServiceExists 23/03/2015 3:45:23 PM 4024 (0x0FB8) [Installation] :: Failed to determine the SCCM client version number. Error Record: ------------- Message : Cannot convert the "@{Version=4.0.6487.2000}" value of type "Selected.System.Management.ManagementObje ct" to type "System.Version". InnerException : System.Management.Automation.PSInvalidCastException: Cannot convert the "@{Version=4.0.6487.2000}" val ue of type "Selected.System.Management.ManagementObject" to type "System.Version". at System.Management.Automation.LanguagePrimitives.ConvertTo(Object valueToConvert, Type resultType , Boolean recursion, IFormatProvider formatProvider, TypeTable backupTypeTable) at System.Management.Automation.ArgumentTypeConverterAttribute.Transform(EngineIntrinsics engineInt rinsics, Object inputData, Boolean bindingParameters, Boolean bindingScriptCmdlet) FullyQualifiedErrorId : RuntimeException PositionMessage : At \\WSname\d$\PackageName\AppDeployToolkit\AppDeployToolkitMain.ps1:7728 char:32 + [version]$SCCMClientVersion <<<< = Get-WmiObject -Namespace 'ROOT\CCM' -Class 'CCM _InstalledComponent' -ErrorAction 'Stop' | Where-Object { $_.Name -eq 'SmsClient' } | Select-Object - Property 'Version' -ErrorAction 'Stop' Error Inner Exception(s): ------------------------- Message : Cannot convert the "@{Version=4.0.6487.2000}" value of type "Selected.System.Management.ManagementObje ct" to type "System.Version". InnerException : Install-SCCMSoftwareUpdates 23/03/2015 3:45:23 PM 4024 (0x0FB8) [Installation] :: Failed to trigger installation of missing software updates. Error Record: ------------- Message : SCCM 2007 or lower, which is incompatible with this function, was dectected on this system. InnerException : FullyQualifiedErrorId : SCCM 2007 or lower, which is incompatible with this function, was dectected on this system. PositionMessage : At \\WSname\d$\PackageName\AppDeployToolkit\AppDeployToolkitMain.ps1:7736 char:10 + Throw <<<< "SCCM 2007 or lower, which is incompatible with this function, was dect ected on this system." Install-SCCMSoftwareUpdates 23/03/2015 3:45:23 PM 4024 (0x0FB8) [Installation] :: Error Record: ------------- Message : Failed to trigger installation of missing software updates: SCCM 2007 or lower, which is incompatible with this function, was dectected on this system. InnerException : FullyQualifiedErrorId : Failed to trigger installation of missing software updates: SCCM 2007 or lower, which is incomp atible with this function, was dectected on this system. PositionMessage : At \\WSname\d$\PackageName\AppDeployToolkit\AppDeployToolkitMain.ps1:7775 char:10 + Throw <<<< "Failed to trigger installation of missing software updates: $($_.Excep tion.Message)" Deploy Application 23/03/2015 3:45:23 PM 4024 (0x0FB8) [Installation] :: Bypassing Dialog Box [Mode: NonInteractive]: Error Record: ------------- Message : Failed to trigger installation of missing software updates: SCCM 2007 or lower, which is incompatible with this function, was dectected on this system. InnerException : FullyQualifiedErrorId : Failed to trigger installation of missing software updates: SCCM 2007 or lower, which is incomp atible with this function, was dectected on this system. PositionMessage : At \\WSname\d$\PackageName\AppDeployToolkit\AppDeployToolkitMain.ps1:7775 char:10 + Throw <<<< "Failed to trigger installation of missing software updates: $($_.Excep tion.Message)" ... Show-DialogBox 23/03/2015 3:45:23 PM 4024 (0x0FB8) [Installation] :: PullSccmWsusUpdates_v1r1 Installation completed with exit code [60001]. Exit-Script 23/03/2015 3:45:23 PM 4024 (0x0FB8) [Installation] :: ------------------------------------------------------------------------------- Exit-Script 23/03/2015 3:45:30 PM 4024 (0x0FB8) ```

Created Unassigned: Powershell Application Toolkit Show-InstallationPrompt -ButtonLeftText "No" [191]

$
0
0


Ok so I have the following scripted:

Show-InstallationPrompt -Message 'You are about to remove Notepad++ 6.7.5 from your computer. Please select "OK" to continue. Thank you!' -ButtonLeftText "No" -ButtonRightText 'OK' -Icon Warning

When I select "OK" the script continues and the uninstall works perfect. The problem is that when I select "No", the script doesn't exit...it just runs the install as if I selected "OK".

According to the documentation:

Show-InstallationPrompt
Synopsis : Displays a custom installation prompt with the toolkit branding and optional buttons.
Description:
Any combination of Left, Middle or Right buttons can be displayed. The return value of the button clicked by the user is the button text specified.


So if "No" is selected it should return "No" and not allow the rest of the script to run...correct????

Can someone help me???
Viewing all 2341 articles
Browse latest View live


Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>