Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions Docs/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,48 @@ Script 0.1.0 WindowsShell {Add-ShellLibrary, ...

You should see some details about the WindowsShell module output by the `Get-Module` command as shown above.

## Configuring Windows Shortcuts
The WindowsShell module implements two interfaces for configuring shell libraries:

* the PowerShell command `Invoke-ProcessShortcut`
* the DSC Resource `Shortcut`

## Commands

The following command creates a Windows shortcut to `powershell.exe` on the desktop and assigns hotkeys to it.

```PowerShell
$splat = @{
Path = "$env:USERPROFILE\Desktop\powershell.lnk"
TargetPath = (Get-Command powershell.exe).Path
Hotkey = 'Ctrl+Alt+Shift+P'
}
Invoke-ProcessShortcut Set Present @splat

```

The results can be observed using Windows Explorer.

<img src="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">

### DSC Resource

Invoking the following ZeroDSC commands creates the same desktop shortcut as shown in the "Command" section above, except using the `Shortcut` DSC resource:

```PowerShell
$instructions = ConfigInstructions PSHotkey {
Get-DscResource Shortcut WindowsShell | Import-DscResource

Shortcut PSHotkey @{
Path = "$env:USERPROFILE\Desktop\powershell.lnk"
TargetPath = (Get-Command powershell.exe).Path
Hotkey = 'Ctrl+Alt+Shift+P'
}
}

$instructions | Invoke-ConfigStep
```

## Configuring Windows Shell Libraries

The WindowsShell modules implements two interfaces for configuring shell libraries:
Expand Down
17 changes: 8 additions & 9 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,19 @@

# WindowsShell

WindowsShell is a PowerShell module for configuring Windows Shell Libraries.
WindowsShell is a PowerShell module for configuring Windows Shell Libraries and Shortcuts.

# Use

Configure Windows Shell Libraries like this
* Configure Windows Shortcuts
* Configure Windows Shell Libraries
* Perform the configuration using straightforward PowerShell commands
* Perform the configuration using PowerShell DSC

<img src="https://cloud.githubusercontent.com/assets/11237922/21626090/0069d2a4-d1c4-11e6-806c-47273fe07b92.png" alt="windows explorer showing shell library" width="400">

using straightforward PowerShell commands like this
### What's a Windows Shell Library?
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.

```PowerShell
PS C:\> $iconPath = "$env:SystemRoot\System32\WindowsPowerShell\v1.0\powershell.exe"
PS C:\> Invoke-ProcessShellLibrary Set Present 'PSModulePath' -IconFilePath $iconPath
```
<img src="https://cloud.githubusercontent.com/assets/11237922/21626090/0069d2a4-d1c4-11e6-806c-47273fe07b92.png" alt="windows explorer showing shell library" width="400">

# Getting Started

Expand Down