THWACK logo
THWACK
  • Sign In
  • Search
  • Community
    Community

    Find all you need to begin your THWACK journey, including documentation, missions, blogs, community groups, events, and media.

    Command Central
    • Getting Started
    MVP Program
    • MVP Program
    Monthly Mission
    • Hidden Gems
    Blogs
    • Community Announcements
    • Product Blog
    Groups
    • DevOps Discourse
    • Data Driven
    • See All Groups
    Events
    • SolarWinds User Group
    • THWACKcamp
      • ↪ 2024: On Demand
    • Bracket Battle
    Media Vault
    • Movies & Mainframes
    • TechPod
    • THWACK Tech Tips
    • THWACK Livecast
    • SolarWinds Lab Archive
    • THWACKcamp Archive
    • See All Media
  • Products
    Products

    Find the best place to learn and ask questions about your SolarWinds products.

    Observability
    • Observability Solutions
    • SolarWinds Observability SaaS
    • SolarWinds Observability Self-Hosted
    • SolarWinds Platform
    Network Management
    • Network Performance Monitoring
    • NetFlow Traffic Analyzer
    • Network Configuration Manager
    • IP Address Manager
    • User Device Tracker
    • VoIP & Network Quality Manager
    • Log Analyzer
    • Engineer's Toolset
    • Network Topology Mapper
    • Kiwi CatTools
    • Kiwi Syslog Server
    • ipMonitor
    Application Management
    • AppOptics
    • Loggly
    • Papertrail
    • Pingdom
    • DevOps
    IT Security
    • Access Rights Manager
    • Identity Monitor
    • Security Event Manager
    • Patch Manager
    • Serv-U FTP & MFT
    IT Service Management
    • SolarWinds Service Desk
    • Web Help Desk
    • DameWare Remote Support
    • DameWare Remote Everywhere
    • DameWare Mini Remote Control
    System Management
    • Server & Application Monitor
    • Virtualization Manager
    • Storage Resource Monitor
    • Server Configuration Monitor
    • SolarWinds Backup
    • Web Performance Monitor
    Database Management
    • Database Performance Analyzer
    • SQL Sentry
    • Database Performance Monitor
    • Database Mapper
    • Task Factory
  • Content Exchange
    Content Exchange

    Find downloadable files and templates other users have built and found useful to share with others.

    SolarWinds Platform
    • Alerts
    • Custom HTML
    • Custom Queries
    • Modern Dashboards
    • Reports
    • Scripts
    Server & Application Monitor
    • API Pollers
    • Application Monitor Templates
    Database Performance Analyzer
    • Custom Alerts
    • Custom Metrics
    • Custom Queries
    Server Configuration Monitor
    • Policies
    • Profiles
    Network Performance Monitor
    • Device Pollers
    • Universal Device Pollers
    Network Configuration Manager
    • Config Change Scripts
    • Device Templates
    • Firmware Upgrade Templates
    • Policy Documents
    SQL Sentry
    • Advisory Conditions
    Web Help Desk
    • Style Sheets
  • Resources
    SolarWinds Customer Portal Customer Portal

    Create individual user accounts for your team, manage your licenses, download your SolarWinds software, create and track support tickets, and more.

    SolarWinds Academy Academy

    A one-stop-shop for world-class training for SolarWinds products through on-demand videos, and instructor-led classes. All SolarWinds Academy content is included with every software purchase.

    SolarWinds Customer Success Support

    Get help when you need it from a world-class support team, available to assist with technical product issues 24 hours a day, seven days a week, 365 days a year.

    SolarWinds Partner Portal Partner Portal

    Accelerate SolarWinds Partners’ ability to drive digital and IT transformation for customers with powerful tools, resources, and increased profit potential.

  • Free Tools & Trials
  • Store
The SolarWinds Platform
  • Products
The SolarWinds Platform
SolarWinds Platform API Using PowerShell 7+ and Visual Studio Code
  • Newsroom
  • Forums
  • SolarWinds Platform API
  • Content Exchange
  • What We're Working On
  • Feature Requests
  • More
  • Cancel
  • New
  • -SolarWinds Platform API
    • About the SolarWinds Information Service (SWIS)
    • +Setting up a Python Development Environment
    • -Using PowerShell 7+ and Visual Studio Code
      • +Step-by-Step Installation Instructions [PowerShell 7+]
      • Initial Launch of Visual Studio Code
    • +SolarWinds Query Language (SWQL) Basics
    • +Data Presentation Examples
    • Additional Resources
    • Glossary

Using PowerShell 7+ and Visual Studio Code

For years now, the SolarWinds Orion API has been accessible to run via PowerShell on Windows machines. Initially through the Snap-In (SwisSnapIn) and later through the Module (SwisPowerShell).Although not technically deprecated, the Windows PowerShell 5.1 engine is being phased out for replacement with PowerShell 7 (formerly PowerShell Core).

Our approach to working with the functionality needs to change with time.

The (Extremely) Quick Intro to PowerShell 7

The most succinct way to describe how PowerShell 7 differs from previous Windows PowerShell versions is in the name – it lacks “Windows.” PowerShell 7 is a cross-platform management framework that runs on Windows, macOS, Linux, and even ARM processors. This allows for the same scripts to run anywhere and everywhere. It’s a bold move and one move in the right direction, but some things have been left behind.

Where is PowerShell ISE?

To put it bluntly, the Integrated Scripting Environment (ISE) is no longer maintained. Like Windows PowerShell 5.1, the ISE can only run on Windows machines. And while all modern versions of Windows can support it, its lack of cross-platform functionality was counterproductive given the multi-operating system support for PowerShell 7. For proper multi-platform support, something new needed to be used.

Enter Visual Studio Code

The de facto replacement for the PowerShell ISE is Visual Studio Code (VS Code), and it’s for so much more than just PowerShell. VS Code supports dozens and dozens of programming languages, has thousands of extensions to make working more manageable and more efficient, and has a modern aesthetic to boot. Don’t be fooled by the name, Visual Studio Code is not the same as Visual Studio.

VS Code is supported on most major platforms (x86, x64, ARM, and ARM-64) and most operating systems (Windows, Linux, macOS).This makes it an excellent tool if you are just getting started with scripting, as the experience will be near identical for all your collaborators, regardless of the OS or platform.

Why aren’t PowerShell 7 and VS Code bundled together?

There are many reasons, but the core of it is that PowerShell is a command line interpreter and needs no GUI, whereas VS Code is a visual editor and needs a GUI. If you have a Linux machine that doesn’t have Gnome, KDE, or another X Windows system installed, you can still run PowerShell. Just install it, and it’s available to use from the terminal.

The Key to Using a Tool is Flexibility

Microsoft knew that when they started moving PowerShell (and any associated editor) to an open-source solution, consumers would want to use the tools in the best way possible for their own situations.That versatility was part of the original mandate for designing VS Code.If you want to write a script in Perl, you need to be able to do it.If you want to work in Python, you need that capability.If C# was your forte, so be it; the tool must support that.If all you touch is HTML and CSS, the solution must work for you.Nothing differentiates Visual Studio Code from traditional Visual Studio products more than its ease of extensibility and configuration for the casual scripter/programmer/web dev.

Part of embracing this flexibility is using the best tools for you.This widely depends on if you have a preferred Integrated Development Environment/Integrated Scripting Environment (IDE/ISE) or prefer to work in other ways.VS Code is not the only option available to you.Many successful scripters work in nothing but a plain text editor like nano, notepad, emacs, vim, or Notepad++.If you prefer Sublime, Eclipse, the full Visual Studio product, or something else, please feel free to use that.Each choice comes with its benefits and determents.

For the sake of continuity, this book uses Visual Studio Code (referred to as “VS Code”) for all screenshots.All code samples provided in this book will work provided the following:

  • You have installed PowerShell version 7 or higher.
  • You have installed the SolarWinds Orion PowerShell module version 3 or higher.

If you elect to work with another editor (or multiple editors), please work in whatever way makes you most comfortable.

Co-hosting with Orion Platform Products

No rule says you cannot install PowerShell 7 and VS Code on the server running your Orion Platform products, but my go-to has always been to run them adjacent to those machines. It doesn’t even need to be a server; it just needs to be a computer where you have some GUI. I have always preferred to have a UTIL server on the same subnet as my Orion servers. It makes it so that I can easily do work on the UTIL server (including rebooting or restarting local services after updates), and I won’t disturb my monitoring solution from doing its job.

The following steps show how to set up PowerShell 7 and VS Code on a separate machine from that running the SolarWinds Orion platform products. The steps are outlined in detail on Microsoft’s site [PowerShell, VS Code] to install both PowerShell 7 and VS Code. Please refer to those documents if you have problems.

Again, if you prefer not to use Visual Studio Code, you can install the SolarWinds Orion PowerShell module after completing your PowerShell 7 installation. Follow the instructions for Installing the SolarWinds Orion PowerShell Module from a regular PowerShell session.

Continue to the Step-by-Step Installation Instructions [PowerShell 7+] section.

  • Linux
  • VS Code
  • macOS
  • Visual Studio Code
  • SolarWinds Platform
  • PowerShell 7
  • Windows
  • Share
  • History
  • More
  • Cancel
Related
Recommended

SolarWinds solutions are rooted in our deep connection to our user base in the THWACK® online community. More than 200,000 members are here to solve problems, share technology and best practices, and directly contribute to our product development process.

SolarWinds Customer Success Center Certification SolarWinds Lab Link Customer Portal
About THWACK SolarWinds Blog Federal & Government Edit Settings Free Tools & Trials
Legal Documents Terms of Use Privacy California Privacy Rights Security Information
©2021 SolarWinds Worldwide, LLC. All Rights Reserved.