Tag: Script
-
如何使用PowerCLI获取物理RDM LUN的路径选择策略
获取RDM磁盘信息是一件很磨人的事儿,如果你很仔细你就需要把每台都检查一遍以确保信息是一致的。研究出来两行命令,可以批量获取RDM磁盘信息。
-
How to integrate PowerCLI with PowerShell and PowerShell ISE
I wrote a post about how to integrate PowerCLI with PowerShell manually. I rebuilt my computer few days ago, need to integrate PowerCLI again. I used to scripting by PowerGUI, but something always lead to PowerGUI lost menu, it frustrated me a long time. I cannot figured out what’s the root cause. So I wondered…
-
Extremely slow when run PowerShell script by scheduled taks
I like automition/programming as much as I like Windows, my first offical training in University was VB, then I learned PHP and HTML after graduated. I can’t believe my first PHP program was welcomed in internel. But I stopped develop the skill. I got lot of special request for virtual environment. Some people want to monitor…
-
$array.count does not show anything in PowerCLI
I developed a script to take snapshot on VM and delete older snapshot regularly. I used variable $snapshots to receive data from Get-Snapshot command, then determine how many existing snapshots according to return of $snapshots.count. Somehow the script always ran incorrect behavior. When I deep looked into $snapshots, I found a interesting things. Computer A, $snapshots.count return nothing if no, or…
-
How to get HBA WWPN of ESXi hosts
It’s busy month, I haven’t update my blog since I back from Phuket with my wife. I’m running into multiple projects, a little overload. Just a quick share, my storage team ask me provide WWPN of all hosts to do a health check. it’s nightmare to pull out the data from vSphere client or web…
-
How to Add VMware PowerCLI to Standard PowerShell Enviroenment
1. create a file with name “Profile.ps1” under %windir%system32WindowsPowerShellv1.0profile.ps1 2. Add following content to the file. # Adds the base cmdlets Add-PSSnapin VMware.VimAutomation.Core # Add the following if you want to do things with Update Manager #Add-PSSnapin VMware.VumAutomation # This script adds some helper functions and sets the appearance. You can pick and choose parts…