Blog Viewer

Scripting How-To: Windows PowerShell

By Erdem posted 08-08-2015 06:08



Configure and interact with Junos devices using Windows PowerShell.


Windows PowerShell is a powerful built-in scripting language by Microsoft. It is included on all devices running at least Windows 7, and can be downloaded as a separate installation on older versions of Windows.

I recommend the following resources to help you get familiar with PowerShell:

Posh-Junos Module

With the help of the Posh-Junos module, you can use PowerShell to interact with Junos devices in the following way:

  • Get software information on a given device.
  • Configure multiple devices using a template-style format for custom values.
  • Configure multiple devices with the same set of commands.
  • Quick configuration of a single device.
  • Execute remote commands and display/save the output.
  • Generate traffic-selectors (multi proxy-ID's) for SRX devices.


You can get the Posh-Junos module by using any of the following methods

  • Visit the Github project page to install it manually.
  • Use PsGet if you have it installed (highly recommended), and run the following command​
1	Install-Module Posh-Junos
  • Run the following script in your PowerShell console to automatically install it:
1	iex (New-Object Net.WebClient).DownloadString("")


For more detailed documentation and examples on how to use the module, please visit the Github project Wiki.


Contribution by Scott Ware, April 2014