PowerShell is becoming more and more powerful, including a large number of cmdlets commands. It can be seen that it has become one of the key points of Windows development. Script Language has now formed the foundation of many core products of suppliers. This article summarizes 12 simple PowerShell skills for your reference.
PowerShell and XML
How can PowerShell read XML? You must have PowerShell Parse XML, that is, run XML in the XmlDocument class of. NET Framework, and create a Document Object Model. If XML cannot be parsed or verified, you will get an error.
PowerShell remoting
Remote functions are enabled by default in Windows Server 2012 and must be manually enabled in earlier versions. Use PowerShell remoting to simplify Virtual Machine deployment.
PowerShell and WWF
PowerShell code in a workflow must be translated into something that WWF can understand. Therefore, the switch structure cannot be used in WWF. However, you can use a special parallel structure for each structure to allow PowerShell to execute multi-thread activities.
SEARCH Command
PowerShell v3 can search for commands in all installed modules. However, if you try to run an unloaded command, shell will help you load it in the background.
PowerCLI and vCloud
The abstraction layer introduced in vCloud Director 1.5 allows you to use PowerCLI scripts to search VM) and collect granular information.
PowerCLI and View Management
Using PowerShell scripts to reset and recreate environments is usually faster than using Web management tools. Lelets and scripts can also be used to establish a consistent View environment.
Virtual Machine migration
You can migrate any VM, No matter what cluster it is in or what PowerShell script it uses. You only need the cluster alias, the exact name of the cluster VM resource and the target node.
XenServer PowerShell snap-in
Using Windows PowerShell cmdlets can improve XenServer management. Run PowerShell snap-in on a 64-bit system. Run the following command to register the DLL and 64-bit. NET Framework. C: windowsmicrosoft. netframeowkr64v2.0.50727 installutil.exe "c: program files (x86) citrixxenserverpssnapin xenserverpssnapin. dll"
VMware vSphere PowerShell snap ins
VMware. ImageBuilderallows creates custom ESXi images and media. You can enable automatic deployment or use these images as independent installation media.
PowerShell Web Access
Web Access introduced by PowerShell v3 contains the Web command line window. multiple concurrent connections and tabs are supported, and one HTTPS connection can be fixed. Remember that IIS is a prerequisite for this feature.
Windows Task Scheduler and PowerShell
To use the predefined PowerShell script, make sure that the policy is correctly executed. All scripts executed using Task Scheduler must have signatures and code signature certificates issued by the Authority.
PowerCLI and vSphere API
VSphere APIs are more structured than operating systems. PowerCLI is built on the same API, which means you cannot use PowerCLI to directly execute tasks on the console OS.