Hello,
I had a script that worked fine alone with Task scheduler, basically it ran chrome, made him call an url which downloaded an excel file and saved it automatically in the Downloads directory.
A GPO has just been applied which sets to YES the parameter “Ask where to save each file before downloading” in chrome (and Edge too). This now triggers a popup to show up, which needs manual action.
So I wanted to know how, in powershell, I could simulate the click on the “Save” button of the “Save As” popup that appears now ? The window directly opens in the good directory Downloads but if there is also a way to make sure about this directory by setting it before validating the save, that would be even better.
Thanks for your help.
This is basically the part of the script that calls chrome, that I have now :
$pathToChrome = ‘C:\Program Files\Google\Chrome\Application\chrome.exe’
$tempFolder = ‘–user-data-dir=’ + $env:Temp + ‘\temp_chrome_sc_request’
$startmode = ‘–default’$startPage = ‘https://instancelambda.service-now.com/nav_to.do?uri=%2Fsc_request_list.do%3FXLSX%26sysparm_<sysparmTypeOrField=value>%26sysparm_fields=reassignment_count,location,number,opened_at,short_description,requested_for,priority,request_state,u_business_service,business_service,calendar_duration,sla_due,made_sla,u_other_service,assignment_group,assigned_to,sys_updated_on,sys_updated_by,contact_type,closed_by,sys_created_on,sys_created_by’
$downloadpath = ‘C:\Users' + $env:USERNAME +’\Downloads'
$app=Start-Process -FilePath $pathToChrome -ArgumentList $tempFolder, $startmode, $startPage -PassThru -WindowStyle Minimized