Created
October 26, 2017 01:39
-
-
Save AglaianWoman/1441a4baf6599f67d23d0dee83570213 to your computer and use it in GitHub Desktop.
PowerShell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add PowerCLI snapin and connect to server, if not already done | |
if (!(Get-PSSnapin VMware.Vimautomation.Core -ErrorAction SilentlyContinue)) { | |
Add-PSSnapin Vmware.Vimautomation.Core | |
} | |
if (!$global:DefaultVIServer) { | |
Connect-VIServer <vCenterServer> | |
} | |
# Analyze XML data | |
[xml] $xmldata = Get-Content "C:\path.xml" | |
$xmldata.Foo.Bar | %{$_.Name} | Select-Object Critera | |
# Set execution policy for current user (does not require administrator privileges) | |
Set-ExecutionPolicy Unrestricted -Scope CurrentUser | |
# Map network drive | |
New-PSDrive -Name "Z" -PSProvider FileSystem -Root "\\raytheon\users\bmm" -Persist |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment