Briefly talk about the new command in PowerShell 4.0 _powershell

Source: Internet
Author: User
Tags change settings hash sha1 hash

With the release of PowerShell 3.0 and Windows Server 2012, Microsoft has upgraded the functionality of Windows PowerShell, when released PowerShell 4.0 and Windows Server version R2, Microsoft will also continue to add new features and improve existing functionality. In this article, we counted the 10 new commands in PowerShell 4.0.

Save-help

Get-help is the PowerShell entry level command. Get-member help get content, you can use it to view the properties and methods of another PowerShell object. The new feature in PowerShell 4.0 is the ability to update the system more easily depending on the help file without connecting to the Internet. PowerShell 3 can only help with locally installed modules. If you want to get all the PowerShell help, you must install each module on the local machine. Now you can use the SAVE-HELP command to get any help you want.

Enable-vmintegrationservice

The cmdlet is included in Windows Server 2012 and the guest Service interface parameters are expanded in Windows Server R2. The service is turned off by default, enabling the server to set the page through the VM in Hyper-V Manager or use the PowerShell command, such as Enable-vmintegrationservice-name Guest Service Interface "Baseline Server". enabling (or disabling) Integration services on each VM requires only one line of code.

Copy-vmfile

Moving a file to or from a virtual machine can cause problems. First, you need to install Integration services to open file sharing. This only requires a simple PowerShell command: Enable-vmintegrationservice. But you have to log into the virtual machine and copy the files to or from a network share or copy them from a network share. If you have many virtual machines, this task will be heavy. Now, you just need to type the Copy-vmfile command in the PowerShell. It can effectively copy files to a virtual machine, or copy files on a virtual machine.

Get-filehash

Simply put, the Get-filehash cmdlet computes any one or more hash files. You can even choose an algorithm. This is useful when checking the consistency of a large number of downloads, such as the ISO files for Windows Server R2. Microsoft provides a SHA1 hash of all downloaded files, and you can use this cmdlet now to compute.

Start-dscconfiguration

Keeping the server configuration status known is a challenge in any environment. So many administrators have so many opportunities to change settings, you can disable any features of the server. PowerShell 4.0 introduces automated configuration management in the form of desired state configuration. DSC uses a script based configuration file that is created by PowerShell Ise. These profiles are converted into MOF files, and the server configuration is set or checked by the Start-dscconfiguration cmdlet.

Get-netnat

Microsoft has invested a lot of energy in the new network features in Windows Server R2, from the new multi-tenant VPN gateway to the PowerShell cmdlets, which is named after the network term.

Get-netnat is part of the Netnat module, and the Netnat module also contains New-netnat and Set-netnat. Configuring network address translation on a remote machine is the core of Microsoft's hybrid cloud strategy, where you can connect a local machine to a machine in the cloud, as if you were communicating in the same LAN. These PowerShell commands can create and delete NAT connections simply by running a simple script.

Set-scheduledjob

Running a job at a specific time is a skill that every system administrator must master. The Set-scheduledjob cmdlet introduced in PowerShell 3.0 can run almost any PowerShell script or scheduled schedule at a specific time. PowerShell 4.0 adds keyword parameter runnow to make the task easier to complete. New-jobtrigger and Set-jobtrigger Another new parameter is repeatindefinitely, for tasks that need to be opened and run permanently.

Get-vmfirmware

Windows Server R2 Hyper-V introduces a second-generation virtual machine. This new architecture includes BIOS firmware that can be updated or replaced. You can use Get-vmfirmware to retrieve the BIOS firmware version of the specified virtual machine and use the Set-vmfirmware command to modify the firmware.

Test-netconnection

Network fault diagnosis is undoubtedly one of the most frustrating problems that IT administrators must endure. Windows often provides a small number of built-in tools to solve this problem. With PowerShell 4.0, the day to troubleshoot network failures will be much easier. The Test-netconnection cmdlet consolidates multiple tests into a simple command with several parameters. For example, command Test-netconnection-computername www.searchsv.com.cn-InformationLevel Detailed will attempt to connect to the site www.searchsv.com.cn and return the diagnostic information for the detailed list.

Test-vmnetworkadapter

Clearly, the network in Windows Server R2 has received a lot of attention. Virtual networks require a large number of troubleshooting practices. Now you can enjoy the convenience of the PowerShell prompts to run a series of tests on the virtual machine network adapter.

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.