Coder Social home page Coder Social logo

Comments (10)

mmashwani avatar mmashwani commented on July 29, 2024

If anyone else is seeing the same issue, please report your results as I have not been able to reproduce the problem.

from psappdeploytoolkit.

dersonc avatar dersonc commented on July 29, 2024

@mmashwani I just tested running it on the same Windows 7 machine, but with PowerShell 4 instead of PowerShell 2. With PowerShell 4 the functions run as expected, so it seems like some part of the code is only compatible with v4.

Here are the logs when running with PowerShell 4:

PSAppDeploy Toolkit log:

[Initialization] :: *******************************************************************************     1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: *******************************************************************************     1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: [.NET.Framework.4.5.2.Multi-Targeting.Pack_4.5.51651_001] setup started.        1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: Script [C:\Users\ZZZZZZZ.YYYY\Desktop\AppDeployToolkit\AppDeployToolkitMain.ps1] dot-source invoked by [C:\Users\ZZZZZZZ.YYYY\Desktop\Deploy-Application.ps1]       1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: Script [C:\Users\ZZZZZZZ.YYYY\Desktop\AppDeployToolkit\AppDeployToolkitExtensions.ps1] dot-source invoked by [C:\Users\ZZZZZZZ.YYYY\Desktop\AppDeployToolkit\AppDeployToolkitMain.ps1]      1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: [.NET.Framework.4.5.2.Multi-Targeting.Pack_4.5.51651_001] script version is [1.0.0]     1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: [Deploy Application] script version is [3.6.1]      1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: [App Deploy Toolkit Main] script version is [3.6.4]     1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: [App Deploy Toolkit Extensions] version is [1.5.0]      1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: Computer Name is [NNNNNNNNNN.YYYY.XXXXXXXXXXXXX.com]        1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: Current User is [YYYY\ZZZZZZZ]      1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: OS Version is [Microsoft Windows 7 Enterprise Service Pack 1 64-bit 6.1.7601.65536]     1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: OS Type is [Workstation]        1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: Current Culture is [en-US] and UI language is [EN]      1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: Hardware Platform is [Virtual:VMWare]       1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: PowerShell Host is [ConsoleHost] with version [4.0]     1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: PowerShell Version is [4.0 x64]     1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: PowerShell CLR (.NET) version is [4.0.30319.18408]      1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: *******************************************************************************     1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: Display session information for all logged on users: 


NTAccount           : YYYY\ZZZZZZZ
SID                 : S-1-5-21-1454471165-2077806209-1801674531-7103031
UserName            : ZZZZZZZ
DomainName          : YYYY
SessionId           : 1
SessionName         : Console
ConnectState        : Active
IsCurrentSession    : True
IsConsoleSession    : True
IsActiveUserSession : True
IsUserSession       : True
IsRdpSession        : False
IsLocalAdmin        : False
LogonTime           : 5/13/2015 10:59:12 AM
IdleTime            : 00:00:00
DisconnectTime      : 
ClientName          : 
ClientProtocolType  : 
ClientDirectory     : 
ClientBuildNumber   : 0



        1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: The following users are logged on to the system: [YYYY\ZZZZZZZ].        1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: Current process is running under a user account [YYYY\ZZZZZZZ].     1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: The following user is the console user [YYYY\ZZZZZZZ] (user with control of physical monitor, keyboard, and mouse).     1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: The active logged on user is [YYYY\ZZZZZZZ].        1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: The active logged on user [YYYY\ZZZZZZZ] has a primary UI language of [EN].     1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: The following UI messages were imported from the config XML file: [UI_Messages_EN].     1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: The active logged on user [YYYY\ZZZZZZZ] has a DPI scale factor of [100] with DPI pixels [96].      1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: Unable to load COM Object [Microsoft.SMS.TSEnvironment]. Therefore, script is not currently running from a SCCM Task Sequence.      1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: Skipping attempt to check for and make the task scheduler services healthy because the App Deployment Toolkit is not running under the [NT AUTHORITY\SYSTEM] account.       1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: Session 0 not detected.     1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: Installation is running in [Interactive] mode.      1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: Deployment type is [Installation].      1/1/1601 12:00:00 AM    0 (0x0000)
[Pre-Installation] :: Get deferral history...       1/1/1601 12:00:00 AM    0 (0x0000)
[Pre-Installation] :: Return fully qualified registry key path [Registry::HKEY_LOCAL_MACHINE\SOFTWARE\XXXX XX XXXXXXX\Packages\PSAppDeployToolkit\DeferHistory\].       1/1/1601 12:00:00 AM    0 (0x0000)
[Pre-Installation] :: Registry key [Registry::HKEY_LOCAL_MACHINE\SOFTWARE\XXXX XX XXXXXXX\Packages\PSAppDeployToolkit\DeferHistory\] does not exist.        1/1/1601 12:00:00 AM    0 (0x0000)
[Pre-Installation] :: User has [1] deferrals remaining.     1/1/1601 12:00:00 AM    0 (0x0000)
[Pre-Installation] :: Convert the date [05/20/2015 11:14:12] to a universal sortable date time pattern based on the current culture [en-US].        1/1/1601 12:00:00 AM    0 (0x0000)
[Pre-Installation] :: User has until [2015-05-20 11:14:12Z] before deferral expires.        1/1/1601 12:00:00 AM    0 (0x0000)
[Pre-Installation] :: Convert the date [05/13/2015 11:14:12] to a universal sortable date time pattern based on the current culture [en-US].        1/1/1601 12:00:00 AM    0 (0x0000)
[Pre-Installation] :: Check for running application(s) [iexplore,winword,notepad]...        1/1/1601 12:00:00 AM    0 (0x0000)
[Pre-Installation] :: The following processes are running: [iexplore,notepad,WINWORD].      1/1/1601 12:00:00 AM    0 (0x0000)
[Pre-Installation] :: Resolve process descriptions...       1/1/1601 12:00:00 AM    0 (0x0000)
[Pre-Installation] :: Finished checking running application(s).     1/1/1601 12:00:00 AM    0 (0x0000)
[Pre-Installation] :: Prompt user to close application(s) [Internet Explorer,Microsoft Office Word,Notepad]...      1/1/1601 12:00:00 AM    0 (0x0000)
[Pre-Installation] :: User has the option to defer.     1/1/1601 12:00:00 AM    0 (0x0000)
[Pre-Installation] :: Close applications countdown has [3600] seconds remaining.        1/1/1601 12:00:00 AM    0 (0x0000)
[Pre-Installation] :: User selected to force the application(s) to close...     1/1/1601 12:00:00 AM    0 (0x0000)
[Pre-Installation] :: Stop process [iexplore] with window title [XXXX XX XXXXXXX Enterprise Identification - Windows Internet Explorer] and prompt to save if there is work to be saved (timeout in [120] seconds)...       1/1/1601 12:00:00 AM    0 (0x0000)
[Pre-Installation] :: Exceeded the [120] seconds timeout value for the user to save work associated with process [iexplore] with window title [XXXX XX XXXXXXX Enterprise Identification - Windows Internet Explorer].      1/1/1601 12:00:00 AM    0 (0x0000)
[Pre-Installation] :: Stop process [iexplore] with window title [XXXX XX XXXXXXX Enterprise Identification - Windows Internet Explorer] and prompt to save if there is work to be saved (timeout in [120] seconds)...       1/1/1601 12:00:00 AM    0 (0x0000)
[Pre-Installation] :: Window [XXXX XX XXXXXXX Enterprise Identification - Windows Internet Explorer] for process [iexplore] was successfully closed.        1/1/1601 12:00:00 AM    0 (0x0000)
[Pre-Installation] :: Stop process [notepad] with window title [Untitled - Notepad] and prompt to save if there is work to be saved (timeout in [120] seconds)...       1/1/1601 12:00:00 AM    0 (0x0000)
[Pre-Installation] :: Window [Untitled - Notepad] for process [notepad] was successfully closed.        1/1/1601 12:00:00 AM    0 (0x0000)
[Pre-Installation] :: Stop process [WINWORD] with window title [Document1 - Microsoft Word] and prompt to save if there is work to be saved (timeout in [120] seconds)...       1/1/1601 12:00:00 AM    0 (0x0000)
[Pre-Installation] :: Exceeded the [120] seconds timeout value for the user to save work associated with process [WINWORD] with window title [Document1 - Microsoft Word].      1/1/1601 12:00:00 AM    0 (0x0000)
[Pre-Installation] :: Stop process ...      1/1/1601 12:00:00 AM    0 (0x0000)
[Pre-Installation] :: Stop process ...      1/1/1601 12:00:00 AM    0 (0x0000)
[Pre-Installation] :: Stop process ...      1/1/1601 12:00:00 AM    0 (0x0000)
[Pre-Installation] :: Stop process [WINWORD] with window title [Document1 - Microsoft Word] and prompt to save if there is work to be saved (timeout in [120] seconds)...       1/1/1601 12:00:00 AM    0 (0x0000)
[Pre-Installation] :: Window [Document1 - Microsoft Word] for process [WINWORD] was successfully closed.        1/1/1601 12:00:00 AM    0 (0x0000)
[Pre-Installation] :: Check for running application(s) [iexplore,winword,notepad]...        1/1/1601 12:00:00 AM    0 (0x0000)
[Pre-Installation] :: Application(s) are not running.       1/1/1601 12:00:00 AM    0 (0x0000)
[Pre-Installation] :: Finished checking running application(s).     1/1/1601 12:00:00 AM    0 (0x0000)
[Pre-Installation] :: [-BlockExecution] parameter specified.        1/1/1601 12:00:00 AM    0 (0x0000)
[Pre-Installation] :: Create scheduled task to cleanup blocked applications in case installation is interrupted.        1/1/1601 12:00:00 AM    0 (0x0000)
[Pre-Installation] :: Retrieve Scheduled Tasks...       1/1/1601 12:00:00 AM    0 (0x0000)
[Pre-Installation] :: [C:\Windows\System32\schtasks.exe] is a valid fully qualified path, continue.     1/1/1601 12:00:00 AM    0 (0x0000)
[Pre-Installation] :: Working Directory is [C:\Windows\System32].       1/1/1601 12:00:00 AM    0 (0x0000)
[Pre-Installation] :: Executing [C:\Windows\System32\schtasks.exe /create /f /tn .NET.Framework.4.5.2.Multi-Targeting.Pack_4.5.51651_001_BlockedApps /xml "C:\Program Files\XXXX XX XXXXXXX\PSAppDeployToolkit\SchTaskUnBlockApps.xml"]...      1/1/1601 12:00:00 AM    0 (0x0000)
[Pre-Installation] :: Execution completed with exit code [0].       1/1/1601 12:00:00 AM    0 (0x0000)
[Pre-Installation] :: Set the Image File Execution Option registry key to block execution of [iexplore.exe].        1/1/1601 12:00:00 AM    0 (0x0000)
[Pre-Installation] :: Return fully qualified registry key path [Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\iexplore.exe].       1/1/1601 12:00:00 AM    0 (0x0000)
[Pre-Installation] :: Set registry key value: [Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\iexplore.exe] [Debugger = wscript.exe "C:\Program Files\XXXX XX XXXXXXX\PSAppDeployToolkit\AppDeployToolkit_BlockAppExecutionMessage.vbs"].       1/1/1601 12:00:00 AM    0 (0x0000)
[Pre-Installation] :: Set the Image File Execution Option registry key to block execution of [winword.exe].     1/1/1601 12:00:00 AM    0 (0x0000)
[Pre-Installation] :: Return fully qualified registry key path [Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\winword.exe].        1/1/1601 12:00:00 AM    0 (0x0000)
[Pre-Installation] :: Create registry key [Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\winword.exe].     1/1/1601 12:00:00 AM    0 (0x0000)
[Pre-Installation] :: Set registry key value: [Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\winword.exe] [Debugger = wscript.exe "C:\Program Files\XXXX XX XXXXXXX\PSAppDeployToolkit\AppDeployToolkit_BlockAppExecutionMessage.vbs"].        1/1/1601 12:00:00 AM    0 (0x0000)
[Pre-Installation] :: Set the Image File Execution Option registry key to block execution of [notepad.exe].     1/1/1601 12:00:00 AM    0 (0x0000)
[Pre-Installation] :: Return fully qualified registry key path [Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe].        1/1/1601 12:00:00 AM    0 (0x0000)
[Pre-Installation] :: Create registry key [Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe].     1/1/1601 12:00:00 AM    0 (0x0000)
[Pre-Installation] :: Set registry key value: [Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe] [Debugger = wscript.exe "C:\Program Files\XXXX XX XXXXXXX\PSAppDeployToolkit\AppDeployToolkit_BlockAppExecutionMessage.vbs"].        1/1/1601 12:00:00 AM    0 (0x0000)
[Installation] :: [C:\Users\ZZZZZZZ.YYYY\Desktop\Files\Setup.exe] is a valid fully qualified path, continue.        1/1/1601 12:00:00 AM    0 (0x0000)
[Installation] :: Working Directory is [C:\Users\ZZZZZZZ.YYYY\Desktop\Files].       1/1/1601 12:00:00 AM    0 (0x0000)
[Installation] :: Executing [C:\Users\ZZZZZZZ.YYYY\Desktop\Files\Setup.exe /s]...       1/1/1601 12:00:00 AM    0 (0x0000)
[Installation] :: Execution completed successfully with exit code [0].      1/1/1601 12:00:00 AM    0 (0x0000)
[Post-Installation] :: Remove the Image File Execution Options registry key to unblock execution of [iexplore.exe].     1/1/1601 12:00:00 AM    0 (0x0000)
[Post-Installation] :: Remove the Image File Execution Options registry key to unblock execution of [notepad.exe].      1/1/1601 12:00:00 AM    0 (0x0000)
[Post-Installation] :: Remove the Image File Execution Options registry key to unblock execution of [winword.exe].      1/1/1601 12:00:00 AM    0 (0x0000)
[Post-Installation] :: Retrieve Scheduled Tasks...      1/1/1601 12:00:00 AM    0 (0x0000)
[Post-Installation] :: Delete Scheduled Task [.NET.Framework.4.5.2.Multi-Targeting.Pack_4.5.51651_001_BlockedApps].     1/1/1601 12:00:00 AM    0 (0x0000)
[Post-Installation] :: [C:\Windows\System32\schtasks.exe] is a valid fully qualified path, continue.        1/1/1601 12:00:00 AM    0 (0x0000)
[Post-Installation] :: Working Directory is [C:\Windows\System32].      1/1/1601 12:00:00 AM    0 (0x0000)
[Post-Installation] :: Executing [C:\Windows\System32\schtasks.exe /Delete /TN .NET.Framework.4.5.2.Multi-Targeting.Pack_4.5.51651_001_BlockedApps /F]...       1/1/1601 12:00:00 AM    0 (0x0000)
[Post-Installation] :: Execution completed successfully with exit code [0].     1/1/1601 12:00:00 AM    0 (0x0000)
[Post-Installation] :: .NET.Framework.4.5.2.Multi-Targeting.Pack_4.5.51651_001 Installation completed with exit code [0].       1/1/1601 12:00:00 AM    0 (0x0000)
[Post-Installation] :: -------------------------------------------------------------------------------      1/1/1601 12:00:00 AM    0 (0x0000)

AppDeployToolkit_BlockAppExecutionMessage.vbs:

strCommand = "powershell.exe -ExecutionPolicy Bypass -NoProfile -NoLogo -WindowStyle Hidden -File " & chr(34) & "C:\Program Files\XXXX XX XXXXXXX\PSAppDeployToolkit\AppDeployToolkitMain.ps1" & chr(34) & " -ShowBlockedAppDialog -ReferringApplication " & chr(34) & ".NET.Framework.4.5.2.Multi-Targeting.Pack_4.5.51651_001" & chr(34)
set oWShell = CreateObject("WScript.Shell")
oWShell.Run strCommand, 0, false

Log from the vbs execution:

[Initialization] :: *******************************************************************************     1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: *******************************************************************************     1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: [App.Deploy.Toolkit.Main_3.6.4_01] setup started.       1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: Script [C:\Program Files\XXXX XX XXXXXXX\PSAppDeployToolkit\AppDeployToolkitMain.ps1] invoked directly      1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: Script [C:\Program Files\XXXX XX XXXXXXX\PSAppDeployToolkit\AppDeployToolkitExtensions.ps1] dot-source invoked by [C:\Program Files\XXXX XX XXXXXXX\PSAppDeployToolkit\AppDeployToolkitMain.ps1]        1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: [App Deploy Toolkit Main] script version is [3.6.4]     1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: The following non-default parameters were passed to [App Deploy Toolkit Main]: [-ReferringApplication ".NET.Framework.4.5.2.Multi-Targeting.Pack_4.5.51651_001" -ShowBlockedAppDialog:$true]        1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: [App Deploy Toolkit Extensions] version is [1.5.0]      1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: Computer Name is [NNNNNNNNNN.YYYY.XXXXXXXXXXXXX.com]        1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: Current User is [YYYY\ZZZZZZZ]      1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: OS Version is [Microsoft Windows 7 Enterprise Service Pack 1 64-bit 6.1.7601.65536]     1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: OS Type is [Workstation]        1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: Current Culture is [en-US] and UI language is [EN]      1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: *******************************************************************************     1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: *******************************************************************************     1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: [App.Deploy.Toolkit.Main_3.6.4_01] setup started.       1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: Script [C:\Program Files\XXXX XX XXXXXXX\PSAppDeployToolkit\AppDeployToolkitMain.ps1] invoked directly      1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: Script [C:\Program Files\XXXX XX XXXXXXX\PSAppDeployToolkit\AppDeployToolkitExtensions.ps1] dot-source invoked by [C:\Program Files\XXXX XX XXXXXXX\PSAppDeployToolkit\AppDeployToolkitMain.ps1]        1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: [App Deploy Toolkit Main] script version is [3.6.4]     1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: The following non-default parameters were passed to [App Deploy Toolkit Main]: [-ReferringApplication ".NET.Framework.4.5.2.Multi-Targeting.Pack_4.5.51651_001" -ShowBlockedAppDialog:$true]        1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: [App Deploy Toolkit Extensions] version is [1.5.0]      1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: Computer Name is [NNNNNNNNNN.YYYY.XXXXXXXXXXXXX.com]        1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: Current User is [YYYY\ZZZZZZZ]      1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: OS Version is [Microsoft Windows 7 Enterprise Service Pack 1 64-bit 6.1.7601.65536]     1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: OS Type is [Workstation]        1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: Current Culture is [en-US] and UI language is [EN]      1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: Hardware Platform is [Virtual:VMWare]       1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: PowerShell Host is [ConsoleHost] with version [4.0]     1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: PowerShell Version is [4.0 x64]     1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: PowerShell CLR (.NET) version is [4.0.30319.18408]      1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: *******************************************************************************     1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: Hardware Platform is [Virtual:VMWare]       1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: PowerShell Host is [ConsoleHost] with version [4.0]     1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: PowerShell Version is [4.0 x64]     1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: PowerShell CLR (.NET) version is [4.0.30319.18408]      1/1/1601 12:00:00 AM    0 (0x0000)
[Initialization] :: *******************************************************************************     1/1/1601 12:00:00 AM    0 (0x0000)

from psappdeploytoolkit.

dersonc avatar dersonc commented on July 29, 2024

@mmashwani Every time I run the script in our environment the log file always generates the date and time as 1/1/1601 12:00:00 AM, that happens for Windows 7 and Windows 8 running either PowerShell 2 or PowerShell 4. Is this normal?

from psappdeploytoolkit.

mmashwani avatar mmashwani commented on July 29, 2024

Great, thanks for the info. I will see what is the problem on PS 2.0 with the prompting to save stuff.

The incorrect date/time is definitely not normal. Not sure if I've seen that on my end. I will have to test it later and see what's going on. The relevang code for this should all be in Write-Log if you want to try and track it down.

from psappdeploytoolkit.

mmashwani avatar mmashwani commented on July 29, 2024

I am not able to replicate your issue with the incorrect date/time on my end on either Windows 7/8. Can you do some more troubleshooting on your end to see what is going on here? Are you perhaps using the same variable names in a higher scope which could be overwriting the value in the Write-Log function?

from psappdeploytoolkit.

dersonc avatar dersonc commented on July 29, 2024

Yes, I'll perform some more troubleshooting and let you know.

One thing I usually change on the main toolkit script that is the following name convention (to match the company standards):

## Set up sample variables if Dot Sourcing the script, app details have not been specified, or InstallName not passed as parameter to the script
If (-not $appName) {
    [string]$appName = $appDeployMainScriptFriendlyName
    If (-not $appVendor) { [string]$appVendor = 'PS' }
    If (-not $appVersion) { [string]$appVersion = $appDeployMainScriptVersion }
    If (-not $appLang) { [string]$appLang = $currentLanguage }
}
If (-not $appRevision) { [string]$appRevision = '001' }
If (-not $appArch) { [string]$appArch = '' }
[string]$installTitle = ("$appName $appVersion $appRevision").Trim()

## Sanitize the application details, as they can cause issues in the script
[string]$appNameWithoutDot = $appName
[char[]]$invalidFileNameChars = [System.IO.Path]::GetInvalidFileNamechars()
[string]$appVendor = $appVendor -replace ' ','.' -replace "[$invalidFileNameChars]",''
[string]$appName = $appName -replace ' ','.' -replace "[$invalidFileNameChars]",''
[string]$appVersion = $appVersion -replace ' ','.' -replace "[$invalidFileNameChars]",''
[string]$appArch = $appArch -replace ' ','.' -replace "[$invalidFileNameChars]",''
[string]$appLang = $appLang -replace ' ','.' -replace "[$invalidFileNameChars]",''
[string]$appRevision = $appRevision -replace ' ','.' -replace "[$invalidFileNameChars]",''

## Build the Installation Name
If ($appArch) {
    [string]$installName = $appName + '_' + $appVersion + '_' + $appRevision + '_' + $appArch
}
Else {
    [string]$installName = $appName + '_' + $appVersion + '_' + $appRevision
}
[string]$installName = $installName.Trim('_') -replace '[_]+','_'

I also tested using the original Main script but the date/time behavior is the same.

from psappdeploytoolkit.

mmashwani avatar mmashwani commented on July 29, 2024
  1. Execution of AppDeployToolkit_BlockAppExecutionMessage.vbs should work fine now using the latest 3.6.4 beta.
  2. Please retest -PromptToSave to see if this issue is still the same.
  3. Were you able to find anything regarding the timestamps on your end?

from psappdeploytoolkit.

dersonc avatar dersonc commented on July 29, 2024
  1. AppDeployToolkit_BlockAppExecutionMessage.vbs is working fine with the latest version.
  2. The issue with -PromptToSave is still present. I also tested it with PowerShell 3 and the issue is not present there, only when using PowerShell 2 the function doesn't work.
  3. The timestamps were actually being written correctly to the log file, the issue was that I was using an old version of CMTrace. Once I updated CMTrace to the latest version the timestamps started showing correctly.

from psappdeploytoolkit.

mmashwani avatar mmashwani commented on July 29, 2024

The -PromptToSave issue should not be fixed in the latest 3.6.5 beta found here: https://github.com/PSAppDeployToolkit/PSAppDeployToolkit/tree/master/Toolkit/AppDeployToolkit

Please test and confirm it is working as expected now.

from psappdeploytoolkit.

dersonc avatar dersonc commented on July 29, 2024

The new version resolves the issue. Thank you so much for looking into this! 😃

from psappdeploytoolkit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.