{"id":787,"date":"2022-12-09T14:18:38","date_gmt":"2022-12-09T13:18:38","guid":{"rendered":"https:\/\/backes.nu\/?p=787"},"modified":"2022-12-09T14:18:38","modified_gmt":"2022-12-09T13:18:38","slug":"download-and-install-the-latest-version-of-5-base-applications","status":"publish","type":"post","link":"https:\/\/backes.nu\/index.php\/2022\/12\/09\/download-and-install-the-latest-version-of-5-base-applications\/","title":{"rendered":"Download and install the latest version of 5 base applications"},"content":{"rendered":"<p>An acquaintance saw my MECM lab environment the other day and saw how I was automatically downloading the latest versions of some applications (which were then automatically distributed and installed on the client computers), and thought it looked &#8220;cool&#8221;.<br \/>\nMy acquaintance does not run MECM, or similar systems. But wanted me to show how he could automatically download and install latest version of some base applications.<br \/>\nSo, I took my scripts and tweaked them for my acquaintance. Which then I thought I&#8217;d post them here (because it&#8217;s been ages since I posted anything).<\/p>\n<p>Here you go, 5 applications that download and install automatically.<\/p>\n<p><strong>7-Zip<\/strong><\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n# 7-Zip\r\n$7ZipDir = &quot;C:\\tmp\\Latest\\Apps\\&quot;\r\n$dlurl = &#039;https:\/\/7-zip.org\/&#039; + (Invoke-WebRequest -Uri &#039;https:\/\/7-zip.org\/download.html&#039; | Select-Object -ExpandProperty Links | Where-Object {($_.innerHTML -eq &#039;Download&#039;) -and ($_.href -like &quot;a\/*&quot;) -and ($_.href -like &quot;*x64.msi&quot;)} | Select-Object -First 1 | Select-Object -ExpandProperty href)\r\n# above code borrowed from: https:\/\/perplexity.nl\/windows-powershell\/installing-or-updating-7-zip-using-powershell\/\r\n$installerPath = Join-Path $7ZipDir (Split-Path $dlurl -Leaf)\r\nInvoke-WebRequest $dlurl -OutFile $7ZipDir\\7z-x64.msi\r\nStart-Process -FilePath &quot;msiexec.exe&quot; -ArgumentList &quot;\/i `&quot;$7ZipDir\\7z-x64.msi`&quot; \/qn ALLUSERS=2 REBOOT=REALLYSUPPRESS&quot; -Wait -PassThru\r\n<\/pre>\n<p><strong># Google Chrome<\/strong><\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n# Google Chrome\r\n$ChromeDir = &quot;C:\\tmp\\Latest\\Apps\\GoogleChromeStandaloneEnterprise64.msi&quot;\r\nInvoke-WebRequest -Uri &quot;http:\/\/dl.google.com\/edgedl\/chrome\/install\/GoogleChromeStandaloneEnterprise64.msi&quot; -OutFile $ChromeDir\r\nStart-Process msiexec.exe -Wait -ArgumentList &#039;\/I $ChromeDir \/qn ALLUSERS=2 REBOOT=REALLYSUPPRESS&#039;\r\nStart-Process -FilePath &quot;msiexec.exe&quot; -ArgumentList &quot;\/i `&quot;C:\\tmp\\Latest\\Apps\\GoogleChromeStandaloneEnterprise64.msi`&quot; \/qn ALLUSERS=2 REBOOT=REALLYSUPPRESS&quot; -Wait -PassThru\r\n<\/pre>\n<p><strong>Microsoft PowerShell 7<\/strong><\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n# Microsoft PowerShell 7\r\n$metadata = Invoke-RestMethod https:\/\/raw.githubusercontent.com\/PowerShell\/PowerShell\/master\/tools\/metadata.json\r\n$release = $metadata.ReleaseTag -replace &#039;^v&#039;;&quot;https:\/\/github.com\/PowerShell\/PowerShell\/releases\/download\/v${release}\/PowerShell-${release}-win-x64.msi&quot;\r\n#above code borrowed from: Ruckzuck.tools\r\n$PowerShellDir = &quot;C:\\tmp\\Latest\\Apps\\PowerShell-7-win-x64.msi&quot;\r\nInvoke-WebRequest -Uri &quot;https:\/\/github.com\/PowerShell\/PowerShell\/releases\/download\/v${release}\/PowerShell-${release}-win-x64.msi&quot; -OutFile $PowerShellDir\r\nStart-Process -FilePath &quot;msiexec.exe&quot; -ArgumentList &quot;\/i `&quot;C:\\tmp\\Latest\\Apps\\PowerShell-7-win-x64.msi`&quot; \/qn ALLUSERS=2 REBOOT=REALLYSUPPRESS&quot; -Wait -PassThru\r\n<\/pre>\n<p><strong>Mozilla Firefox<\/strong><\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n# Mozilla Firefox\r\n$FirefoxDir = &quot;C:\\tmp\\Latest\\Apps\\FirefoxSetup.msi&quot;\r\nInvoke-WebRequest -Uri &quot;https:\/\/download.mozilla.org\/?product=firefox-msi-latest-ssl&amp;os=win64&amp;lang=en-US&quot; -OutFile $FirefoxDir\r\nStart-Process -FilePath &quot;msiexec.exe&quot; -ArgumentList &quot;\/i `&quot;C:\\tmp\\Latest\\Apps\\FirefoxSetup.msi`&quot; \/qn&quot; -Wait -PassThru\r\n<\/pre>\n<p><strong>Notepad++<\/strong><\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n# Notepad++\r\n$NotepadDir = &#039;C:\\tmp\\Latest\\Apps\\&#039;\r\n$href = ((Invoke-WebRequest -Uri &#039;https:\/\/notepad-plus-plus.org\/downloads\/&#039;).Links | Where-Object { $_.innerText -match &#039;current version&#039; }).href\r\n$downloadUrl = ((Invoke-WebRequest &quot;https:\/\/notepad-plus-plus.org\/$href&quot;).Links | Where-Object { $_.innerHTML -match &#039;installer&#039; -and $_.href -match &#039;x64.exe&#039; }).href\r\nInvoke-RestMethod $downloadUrl -OutFile &quot;$NotepadDir\\npp.installer.x64.exe&quot;\r\nStart-Process -FilePath &quot;$NotepadDir\\npp.installer.x64.exe&quot; -ArgumentList &quot;\/S&quot; -PassThru\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>Psst, are you using Microsoft 365? Don&#8217;t miss out my old blog post, <a href=\"https:\/\/translate.google.se\/translate?sl=sv&amp;tl=en&amp;u=https%3A%2F%2Fbackes.nu%2Findex.php%2F2020%2F10%2F09%2Fmicrosoft-365-apps-office-365-hantering-i-mecm-sccm%2F\">Microsoft 365 Apps (Office 365) hantering i MECM (SCCM)<\/a><\/p>\n<p>&nbsp;<\/p>\n<p>#7-Zip, #GoogleChrome, #MicrosoftPowerShell7, #MozillaFirefox, #Notepad++, #Microsoft365Apps<\/p>\n","protected":false},"excerpt":{"rendered":"<p>An acquaintance saw my MECM lab environment the other day and saw how I was automatically downloading the latest versions of some applications (which were then automatically distributed and installed on the client computers), and thought it looked &#8220;cool&#8221;. My&#8230;..<\/p>\n","protected":false},"author":1,"featured_media":798,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[5],"tags":[101,103,100,104,90,106,102,105,25,99],"class_list":["post-787","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-shared-with-the-world","tag-7-zip","tag-chrome","tag-firefox","tag-google-chrome","tag-microsoft-365-apps","tag-microsoft-powershell-7","tag-mozilla-firefox","tag-notepad","tag-powershell","tag-powershell7"],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/backes.nu\/wp-content\/uploads\/2022\/12\/installapps.png?fit=2010%2C626&ssl=1","jetpack-related-posts":[],"jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p5Cu3K-cH","_links":{"self":[{"href":"https:\/\/backes.nu\/index.php\/wp-json\/wp\/v2\/posts\/787","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/backes.nu\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/backes.nu\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/backes.nu\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/backes.nu\/index.php\/wp-json\/wp\/v2\/comments?post=787"}],"version-history":[{"count":10,"href":"https:\/\/backes.nu\/index.php\/wp-json\/wp\/v2\/posts\/787\/revisions"}],"predecessor-version":[{"id":797,"href":"https:\/\/backes.nu\/index.php\/wp-json\/wp\/v2\/posts\/787\/revisions\/797"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/backes.nu\/index.php\/wp-json\/wp\/v2\/media\/798"}],"wp:attachment":[{"href":"https:\/\/backes.nu\/index.php\/wp-json\/wp\/v2\/media?parent=787"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/backes.nu\/index.php\/wp-json\/wp\/v2\/categories?post=787"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/backes.nu\/index.php\/wp-json\/wp\/v2\/tags?post=787"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}