sethosii / vmware-vdi Goto Github PK
View Code? Open in Web Editor NEWScripts and other utilities to administer a VMware Horizon (formerly: View) environement
License: GNU Lesser General Public License v3.0
Scripts and other utilities to administer a VMware Horizon (formerly: View) environement
License: GNU Lesser General Public License v3.0
Hi,
I am unable to run below scripts, I get the exceptions as stated:
1. vmUsers.ps1
Cannot index into a null array.
At C:\Users\anupcp\Desktop\vmware-vdi-master\scripts\vmUsers.ps1:27 char:3
$line = $content[$i]
~~~~~~~~~~~~~~~~~~~~
You cannot call a method on a null-valued expression.
At C:\Users\anupcp\Desktop\vmware-vdi-master\scripts\vmUsers.ps1:28 char:3
$dateLine = $line.Split(",")[0]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get-Date : Cannot bind parameter 'Date' to the target. Exception setting "Date": "Cannot convert null to type
"System.DateTime"."
At C:\Users\anupcp\Desktop\vmware-vdi-master\scripts\vmUsers.ps1:30 char:17
if ((Get-Date $dateLine) -gt (Get-Date $date)) {
~~~~~~~~~
Cannot index into a null array.
At C:\Users\anupcp\Desktop\vmware-vdi-master\scripts\vmUsers.ps1:27 char:3
$line = $content[$i]
~~~~~~~~~~~~~~~~~~~~
You cannot call a method on a null-valued expression.
At C:\Users\anupcp\Desktop\vmware-vdi-master\scripts\vmUsers.ps1:28 char:3
$dateLine = $line.Split(",")[0]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get-Date : Cannot bind parameter 'Date' to the target. Exception setting "Date": "Cannot convert null to type
"System.DateTime"."
At C:\Users\anupcp\Desktop\vmware-vdi-master\scripts\vmUsers.ps1:30 char:17
if ((Get-Date $dateLine) -gt (Get-Date $date)) {
~~~~~~~~~
2. vmUsage.ps1
Get-DesktopVM : No output object matching the Pool_id parameter
At C:\Users\anupcp\Desktop\vmware-vdi-master\scripts\vmUsage.ps1:13 char:10
$vms += Get-DesktopVM -Pool_id $pool.pool_id
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Method invocation failed because [vmware.view.powershell.cmdlets.DesktopVM] does not contain a method named
'op_Addition'.
At C:\Users\anupcp\Desktop\vmware-vdi-master\scripts\vmUsage.ps1:13 char:2
$vms += Get-DesktopVM -Pool_id $pool.pool_id
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Method invocation failed because [vmware.view.powershell.cmdlets.DesktopVM] does not contain a method named
'op_Addition'.
At C:\Users\anupcp\Desktop\vmware-vdi-master\scripts\vmUsage.ps1:13 char:2
$vms += Get-DesktopVM -Pool_id $pool.pool_id
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Method invocation failed because [vmware.view.powershell.cmdlets.RemoteSession] does not contain a method named
'op_Addition'.
At C:\Users\anupcp\Desktop\vmware-vdi-master\scripts\vmUsage.ps1:12 char:2
$sessions += Get-RemoteSession -Pool_id $pool.pool_id -ErrorActio ...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3. unusedVMs.ps1
& : File \vmmanager\E\Project\data\scripts\lastLogin.ps1 cannot be loaded. The file
\vmmanager\E\Project\data\scripts\lastLogin.ps1 is not digitally signed. You cannot run this script on the current
system. For more information about running scripts and setting execution policy, see about_Execution_Policies at
http://go.microsoft.com/fwlink/?LinkID=135170.
At C:\Users\anupcp\Desktop\vmware-vdi-master\scripts\unusedVMs.ps1:11 char:12
$list = & $folder"scripts\lastLogin.ps1" $date
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$list = & $folder"scripts\lastLogin.ps1" $date
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$list = & $folder"scripts\lastLogin.ps1" $date
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$list = & $folder"scripts\lastLogin.ps1" $date
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$list = & $folder"scripts\lastLogin.ps1" $date
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4. lastLogin.ps1
Get-Content : A positional parameter cannot be found that accepts argument 'Select-String'.
At C:\Users\anupcp\Desktop\vmware-vdi-master\scripts\lastLogin.ps1:23 char:17
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get-Content : A positional parameter cannot be found that accepts argument 'Select-String'.
At C:\Users\anupcp\Desktop\vmware-vdi-master\scripts\lastLogin.ps1:23 char:17
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get-Content : A positional parameter cannot be found that accepts argument 'Select-String'.
At C:\Users\anupcp\Desktop\vmware-vdi-master\scripts\lastLogin.ps1:23 char:17
... teAndUser = Get-Content "$usageFileLocation$file" Select-String -NotM ...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Any help would be much appreicated.
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.