You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You should see some details about the WindowsShell module output by the `Get-Module` command as shown above.
36
36
37
+
## Configuring Windows Shortcuts
38
+
The WindowsShell module implements two interfaces for configuring shell libraries:
39
+
40
+
* the PowerShell command `Invoke-ProcessShortcut`
41
+
* the DSC Resource `Shortcut`
42
+
43
+
## Commands
44
+
45
+
The following command creates a Windows shortcut to `powershell.exe` on the desktop and assigns hotkeys to it.
46
+
47
+
```PowerShell
48
+
$splat = @{
49
+
Path = "$env:USERPROFILE\Desktop\powershell.lnk"
50
+
TargetPath = (Get-Command powershell.exe).Path
51
+
Hotkey = 'Ctrl+Alt+Shift+P'
52
+
}
53
+
Invoke-ProcessShortcut Set Present @splat
54
+
55
+
```
56
+
57
+
The results can be observed using Windows Explorer.
58
+
59
+
<imgsrc="https://cloud.githubusercontent.com/assets/11237922/25685638/cb643b9a-301d-11e7-8dfb-374d6060c17e.png"alt="windows explorer and properties dialog box showing desktop shortcut"width="600">
60
+
61
+
### DSC Resource
62
+
63
+
Invoking the following ZeroDSC commands creates the same desktop shortcut as shown in the "Command" section above, except using the `Shortcut` DSC resource:
Copy file name to clipboardExpand all lines: readme.md
+8-9Lines changed: 8 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,20 +2,19 @@
2
2
3
3
# WindowsShell
4
4
5
-
WindowsShell is a PowerShell module for configuring Windows Shell Libraries.
5
+
WindowsShell is a PowerShell module for configuring Windows Shell Libraries and Shortcuts.
6
6
7
7
# Use
8
8
9
-
Configure Windows Shell Libraries like this
9
+
* Configure Windows Shortcuts
10
+
* Configure Windows Shell Libraries
11
+
* Perform the configuration using straightforward PowerShell commands
12
+
* Perform the configuration using PowerShell DSC
10
13
11
-
<imgsrc="https://cloud.githubusercontent.com/assets/11237922/21626090/0069d2a4-d1c4-11e6-806c-47273fe07b92.png"alt="windows explorer showing shell library"width="400">
12
-
13
-
using straightforward PowerShell commands like this
14
+
### What's a Windows Shell Library?
15
+
Windows Shell Libraries are built-in to all versions of Windows beginning with Windows Vista. They provide a standardized way of surfacing folders in the file system in Windows Explorer and most application's file dialog boxes.
PS C:\> Invoke-ProcessShellLibrary Set Present 'PSModulePath' -IconFilePath $iconPath
18
-
```
17
+
<imgsrc="https://cloud.githubusercontent.com/assets/11237922/21626090/0069d2a4-d1c4-11e6-806c-47273fe07b92.png"alt="windows explorer showing shell library"width="400">
0 commit comments