Tag Archives: Links

QuickTip: Pin PowerShell to the Taskbar

When you are working with PowerShell in your daily work it might be worth considering pinning PowerShell to the taskbar. By doing this you have easy access using either the the mouse of the keyboard hotkeys.

PinPowerShell

By placing PowerShell in the first location on the taskbar you will have the following hotkeys available:

Description of action Key Combination
Open new (non-administrative) PowerShell console if not open already, otherwise cycle through open consoles <WIN> 1
Open new Administrative PowerShell console if not open already, otherwise cycle through open consoles <CTRL> <SHIFT><WIN> 1
Open new (non-administrative) PowerShell console even if a console is already open <WIN> <SHIFT> 1
Open the context menu, allows for opening:

  • PowerShell as Administrator
  • PowerShell
  • ISE as Administrator
  • ISE
<WIN> <ALT> 1

Using the mouse you have the following, similar, options available to you. Similar to the keyboard combinations:

Description of action Mouse Combination
Open new (non-administrative) PowerShell console if not open already, otherwise cycle through open consoles Click
Open new (non-administrative) PowerShell console even if a console is already open <SHIFT> Click
Open new Administrative PowerShell console even if a console is already open <CTRL> <SHIFT> Click
Open the context menu, allows for opening:

  • PowerShell as Administrator
  • PowerShell
  • ISE as Administrator
  • ISE
RightClick

Using these key combinations allows you to access PowerShell faster and no mouse-clicking will be required anymore.

Share

QuickTip: Select all links using Invoke-WebRequest

Today I was looking for a way to discover all links on my blog. Invoke-WebRequest returns a number of interesting properties, which can be listed by piping the output into the Get-Member cmdlet:

1
2
Invoke-WebRequest -Uri 'www.jaapbrasser.com' |
Get-Member -MemberType Property

The output from the previous command shows that there is a property named ‘Links’, we will use this property to retrieve all the urls from a site. For example by executing the following code:

1
(Invoke-WebRequest -Uri 'www.jaapbrasser.com').Links.Href

To ensure that only the unique links are selected Select-Object -Unique can be used:

1
2
(Invoke-WebRequest -Uri 'www.jaapbrasser.com').Links.Href |
Select-Object -Unique

Invoke-WebRequest

Share