Win32 app with dependencies have errors
I created two PowerShell scripts. One script is to delete Google's cache called 'deleteGoogleCache.ps1'. The other script is to add the script that deletes Google's cache as a scheduled task to run daily, which is called 'task.ps1'. I need 'task.ps1' to only run when the script to delete Google's cache is installed. So I created two Win32 applications in 'Apps'. In 'Install command' for the Win32 app 'task.ps1', I have the following:
Powershell.exe -ExecutionPolicy ByPass -File .\task.ps1
This is what this scripts does:
$action = New-ScheduledTaskAction -Execute 'Powershell.exe' -Argument 'deleteGoogleCache.ps1'
$trigger = New-ScheduledTaskTrigger -Daily -At 11pm
Register-ScheduledTask -Action $action -Trigger $trigger -TaskName "DeleteGoogleCache" -Description "This delete google's cache daily."
I created a dependencies in 'task1.ps1' Win32 Intune app for 'deletegoogleCache.ps1' because I only want 'task.ps1' to only run when 'deleteGoogleCache.ps1' is present.
Under 'Device status' for 'task.ps1' the status is 'Not installed' and 'Status Details' says '1 or more dependents apps failed to install"
In the InTune Win32 app called 'deleteGoogleCache.ps1' under device status, the status is 'Failed' and the 'Status Details' says "The application was not detected after installation completed successfully (0x87D1041C)"
There is a 'Detection rule' in the deleteGoogleCache Win32 app with a rule type 'File', 'Path' of 'C:\" with File or folder 'deleteGoogleCache.ps1' and the detection method of 'File or folder exists'.
Any help will be greatly appreciated.