diff --git a/Docs/readme.md b/Docs/readme.md index b0e8058..9e3d406 100644 --- a/Docs/readme.md +++ b/Docs/readme.md @@ -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. + +windows explorer and properties dialog box showing desktop shortcut + +### 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: diff --git a/readme.md b/readme.md index ff7cf5f..1504567 100644 --- a/readme.md +++ b/readme.md @@ -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 -windows explorer showing shell library - -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 -``` +windows explorer showing shell library # Getting Started