Getting Started tutorial--ubuntu PowerShell

Source: Internet
Author: User
The following small series for everyone to bring a detail of Ubuntu PowerShell (small white entry must see Tutorial). Small series feel very good, now share to everyone, also for everyone to make a reference. Let's take a look at it with a little knitting.

PowerShell started the open source cross-platform as early as last August, but has not tried it, called PowerShell Core.

Here is a brief introduction to how to install and simple to use, for the students who do not know the PowerShell Core on Ubuntu to provide a little help to get started, thank you for your support ~

PowerShell Core is an open source cross-platform task automation and configuration management system developed by Microsoft that runs on. Net Core.

1. Install the PowerShell Core on Ubuntu 16.04

A) Import public repository GPG key

Curl PACKAGES.MICROSOFT.COM/KEYS/MICROSOFT.ASC | sudo apt-key add-

b) Register Microsoft Ubuntu Repository

Curl Packages.microsoft.com/config/ubuntu/16.04/prod.list | sudo tee/etc/apt/sources.list.d/microsoft.list

c) Update package

sudo apt-get update

d) Installing PowerShell

sudo apt-get install-y PowerShell

2. Use the PowerShell Core

A) Start PowerShell and check the PowerShell version:

b) Added some integration variables that can be used to determine the check system version:

c) Get the available modules:

d) Use of pipelines:

e) Use aliases:

f) use. NET class Library:

3. Basic command table

4. Considerations for PowerShell Core on Linux

A) Case sensitive

Windows is case-insensitive, so PowerShell on Windows is ignored. Linux is however case-sensitive. So PowerShell on Linux is generally ignored in case, but some operating system-level special values are case-sensitive (such as the names of some environment variables):

b) Aliases

PowerShell on Windows has some types of Linux aliases, such as LS, cat, man, etc, however, these aliases on Linux to prevent conflicts no longer exist, the following example, LS in Windows PowerShell is also an alias for Get-childitem, which is not found in the Linux PowerShell core:

5. Use visual Studio code for PowerShell scripting development

A) Install Visual studio:https://code.visualstudio.com/first.

b) Add the PowerShell plugin:

c) Now using this to write a PowerShell script is similar to the ISE in Windows:

D) More methods of use see: Code.visualstudio.com/docs.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.