mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-22 18:08:18 +02:00
Add open-apps-folder.ps1
This commit is contained in:
parent
f5edb4f370
commit
5fb1f52ace
@ -46,7 +46,7 @@ When finished say: "Computer, close file explorer" to close the File Explorer.
|
|||||||
|
|
||||||
`Computer, open` [name] `folder`
|
`Computer, open` [name] `folder`
|
||||||
--------------------------------
|
--------------------------------
|
||||||
Launches the File Explorer with the given folder - replace [name] by: `autostart`, `desktop`, `documents`, `downloads`, `Dropbox`, `home`, `music`, `OneDrive`, `pictures`, `recycle bin`, `repos`, `temporary`, or `videos`.
|
Launches the File Explorer with the given folder - replace [name] by: `apps`, `autostart`, `desktop`, `documents`, `downloads`, `Dropbox`, `home`, `music`, `OneDrive`, `pictures`, `recycle bin`, `repos`, `temporary`, or `videos`.
|
||||||
|
|
||||||
When finished say: "Computer, close file explorer" to close the File Explorer.
|
When finished say: "Computer, close file explorer" to close the File Explorer.
|
||||||
|
|
||||||
|
16
Scripts/open-apps-folder.ps1
Normal file
16
Scripts/open-apps-folder.ps1
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Opens the Apps folder
|
||||||
|
.DESCRIPTION
|
||||||
|
This script launches the File Explorer showing the UWP apps folder.
|
||||||
|
.EXAMPLE
|
||||||
|
PS> ./open-apps-folder
|
||||||
|
.NOTES
|
||||||
|
Author: Markus Fleschutz · License: CC0
|
||||||
|
.LINK
|
||||||
|
https://github.com/fleschutz/PowerShell
|
||||||
|
#>
|
||||||
|
|
||||||
|
& "$PSScriptRoot/open-file-explorer.ps1" "shell:AppsFolder"
|
||||||
|
exit 0 # success
|
||||||
|
|
@ -16,7 +16,14 @@
|
|||||||
param([string]$URL = "http://www.fleschutz.de")
|
param([string]$URL = "http://www.fleschutz.de")
|
||||||
|
|
||||||
try {
|
try {
|
||||||
start-process firefox.exe "$URL"
|
$App = Get-AppxPackage -Name Mozilla.FireFox
|
||||||
|
if ($App.Status -eq "Ok") {
|
||||||
|
# starting Firefox UWP app:
|
||||||
|
explorer.exe shell:appsFolder\$($App.PackageFamilyName)!FIREFOX
|
||||||
|
} else {
|
||||||
|
# starting Firefox program:
|
||||||
|
start-process firefox.exe "$URL"
|
||||||
|
}
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||||
|
Loading…
Reference in New Issue
Block a user