VM-Packages
VM-Packages copied to clipboard
Set Chrome as default browser
Details
I think we should add a googlechrome.defaultbrowser.vm package to add Chrome as default browser as proposed in https://github.com/mandiant/VM-Packages/issues/16.
One idea would be to use the following PowerShell script
Add-Type -AssemblyName System.Windows.Forms
Start ms-settings:defaultapps
Sleep 2
[System.Windows.Forms.SendKeys]::SendWait("{TAB 5}{ENTER}")
Sleep 1
[System.Windows.Forms.SendKeys]::SendWait("{TAB 2}{ENTER}");
But this only works if Google Chrome is the third browser in the list, what I am not sure that is always the case. This is how it looks like for me:
How does it look for others? Does anyone have a better idea to implement it? 🤔
Did we determine if https://github.com/DanysysTeam/PS-SFTA from https://github.com/mandiant/VM-Packages/issues/823 is something we can use or at least take a part of the code to use in our own way?
If not, could we use the alternative from chocolatey? https://community.chocolatey.org/packages/setdefaultbrowser
I have asked legal and they have advised that we send an issue/PR to request the addition of the LICENSE file if we want to use the code.
@emtuls which of the two options (PS-SFTA or the setdefaultbrowser browser) would you prefer to use? If we prefer to use PS-SFTA I can ask them to include the license file.
Whichever is easier imo, but setdefaultbrowser seems pretty easy with it being in chocolatey already. :)