Tag: PowerShell

Last updated by at .

PowerShell for Visual Studio Code

PowerShell for Visual Studio Code 1.0 – Your improved PowerShell ISE

Microsoft yesterday not only announced the new Azure Cloud Shell, Azure PowerShell 4.0, they also announced something I was waiting for a long time. Microsoft finally announced the version 1 of the PowerShell for Visual Studio Code with a lot for great enhancements. David Wilson describes this on the PowerShell Team blog.

This supports the PowerShell development on the following platforms:

  • Windows 7 through 10 with PowerShell v3 and higher
  • Linux with PowerShell v6 (all PowerShell-supported distributions)
  • macOS and OS X with PowerShell v6

Features:

  • PowerShell ISE-like interactive development experience with the PowerShell Integrated Console
  • Rich debugging experience including variables view, call stack, watch window, and various breakpoint types
  • Integrated script analysis and code fixes provided by PSScriptAnalyzer
  • Code navigations that allow you to find definitions and references of functions across your script files
  • Highly configurable code formatter based on community best practices
  • New file and project creation using Plaster templates
  • Editor scripting API through the $psEditor object model

The biggest thing about this for me, is the support to run code line by line, which will help a lot in demos and presentations.

So what does this mean for the PowerShell ISE?

The PowerShell ISE has been the official editor for PowerShell throughout most of the history of Windows PowerShell. Now with the advent of the cross-platform PowerShell Core, we need a new official editor that’s available across all supported OS platforms and versions. Visual Studio Code is now that editor and the majority of our effort will be focused there.
However, the PowerShell ISE will remain in Windows supporting Windows PowerShell with no plans to remove it. We will consider investing effort there in the future if there is a high demand for it, but for now we think that we will be able to provide the best possible experience to the PowerShell community through Visual Studio Code.

Really looking forward to work with PowerShell for Visual Studio Code.



Azure PowerShell Module

Microsoft Azure PowerShell 4.0

Microsoft not only announced the Azure Cloud Shell, Microsoft also announced the Azure PowerShell 4.0. The new Azure PowerShell 4.0.0 adds various improvements and fixes across multiple Azure resources. Focusing on features like Container Service, Service Fabric, Container Registry, SQL, Storage, Replay and a lot more.

You can install the cmdlets via your favorite Azure PowerShell installation path indicated in the Azure PowerShell 4.0.0 release notes.



Azure Cloud Shell

Microsoft Azure Cloud Shell

Today at the Microsoft Build Conference, Microsoft announced the Azure Cloud Shell. The Azure Cloud Shell is a browser-based shell experience to manage and develop Azure resources.

Azure Cloud Shell offers a browser-accessible, pre-configured shell experience for managing Azure resources without the overhead of installing, versioning, and maintaining a machine yourself. Today it gives you a variety of different tools directly from your web browser in the Azure Portal.

Linux shell interpreter

  • Bash
  • sh

Azure tools

  • Azure CLI 2.0 and 1.0

Text editors

  • vim
  • nano
  • emacs

Source control

  • git

Build tools

  • make
  • maven
  • npm
  • pip

Containers

  • Docker
  • Kubectl
  • DC/OS CLI

Databases

  • MySQL client
  • PostgreSql client
  • sqlcmd Utility

Other

  • iPython Client

It also looks like PowerShell will be available later, hopefully it will arrive soon. Microsoft also announced Azure PowerShell 3.0.



Open website from PowerShell

Open website from PowerShell

If you want to directly open a website from the PowerShell console, you can use the Start-Process cmdlet. This will open the website in the default browser:

You can also use “Start” which is an alias for Start-Process:

 



Nano Server PowerShell Package Management

Nano Server PowerShell Package Management

In Nano Server roles, features and drivers live outside of the basic Nano Server Image in Nano Server packages. Nano Server Packages can be found on the Windows Server 2016 media in the Nano Server folder under Packages. You can the New-NanoServerImage or Edit-NanoServerImage PowerShell cmdlets to add them while creating or editing a Nano Server Image. If the Nano Server is already running you have to use PowerShell Package Management to add roles and features to the Nano Server. Here is how this works

Import the Nano Server PowerShell Package Provider

Nano Server PowerShell Package Management

Online install Nano Server Packages on the running Nano Server

Install Nano Server Package PowerShell Package Management

Offline install Nano Server Packages to a VHD or VHDX file

Download and save Nano Server Packages

You can also download the latest version of Nano Server Packages, so you can add them later using the New-NanoServerImage PowerShell cmdlet.

Get Installed Nano Server Packages (Online)

Get Installed Nano Server Packages (Offline)

I hope this helps you how to handle Nano Server Packages using PowerShell Package Management (OneGet).

 

 



Hyper-V Manager ins Azure Server Management Tools SMT

Manage Hyper-V from Azure Server Management Tools

Microsoft released an updated to the Azure Server Management Tools (SMT) and this improves some of the existing tools such as File Explorer and Device Manager. But the big announcement here is, that you now can manage your Hyper-V Server and Virtual Machines directly from Microsoft Azure from where ever you are. This is one of the great examples of using cloud solutions to extend your on premise environment, By using Management as a Service you basically don’t need to updated anything, you just got this new feature available in the Azure portal and you can start using it.

In this update to the Server Management Tools, Microsoft supports the following VM management functionality:

  • Start/Shutdown/Turn off/Pause/Resume
  • Save State/Delete Saved State
  • Take/Apply & rename checkpoints

You can see the Virtual Machines on which are running on the Hyper-V server

Hyper-V Manager in Azure SMT

You can also do basic management of checkpoints

Hyper-V VM in Azure SMT

If you want to know more about the Server Management Tools (SMT) check out my blog post: Manage Nano Server and Windows Server from Azure using Remote Server Management Tools

 



Bash on Windows 10

How to Install Linux Bash on Windows 10

With the Windows 10 Anniversary Update, which was released by Microsoft in Summer 2016, Microsoft included a Windows Subsystem for Linux in Windows 10. This allows you to enable Bash on Windows 10. In this blog post I quickly want to show how you can enable the Windows Subsystem for Linux on Windows 10. This is great if you want to use some Linux tools on your Windows 10 machine. I use it for example to use SSH to connect to Linux Virtual Machines on Azure.

First you have the following requirements:

  • Windows 10 Anniversary Update – Windows 10 Build 14393 and higher
  • 64-bit versions of Windows 10
  • Internet Connection to download the Windows Subsystem for Linux in Windows
  • Active Developer Mode in Windows 10

First enable Developer Mode There are two option you can do this

Open the Settings App, go to Update & Security, go to For developers and enable Developer mode:

Windows 10 - Developer Mode

You can also use the following PowerShell command to enable Developer Mode:

After this you can enable the Windows Subsystem for Linux as a Windows Feature in the Control Panel or PowerShell

Windows 10 - Windows Subsystem for Linux

Run the following PowerShell command to enable the Windows Subsystem for Linux:

Enable Windows Subsystem for Linux using PowerShell

After that you will need to restart your computer.

Now you can open up PowerShell or the command prompt and start using bash. (You can also start Bash directly from the Start Menu)

Bash on Windows 10

Hope this helps you to get started.