troubleshooting Question

Not Launching Chrome from a Powershell within a Task Scheduler

Avatar of ivan rosa
ivan rosaFlag for United States of America asked on
Powershell
4 Comments1 Solution14 ViewsLast Modified:
Hello Guys,
 I have in various PS scripts within the Task Scheduler and they all work fine except for this one that launches a chrome website.

for the sake of the purpose the below would fit my question
$googlePath = "C:\Program Files\Google\Chrome\Application\chrome.exe"
$Google     = "https://www.google.com"
$msn        = "https://www.msn.com"
$getMDate   = (Get-Date).Month


if ($getMDate -eq "5") {
    Start-Process -FilePath $googlePath -ArgumentList $($Google) -Verb RunAs -PassThru
}else{
    Start-Process -FilePath $googlePath -ArgumentList $($msn) -Verb RunAs -PassThru
}

here's a view from the Task Sequence:

Use in Program/script field
%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe
and add argument
-NoProfile -NoLogo -NonInteractive -ExecutionPolicy Bypass -File “C:\Temp\kicks.ps1”
any thoughts? :)
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 4 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros