Git Product home page Git Product logo

vmware-vdi's People

Contributors

sethosii avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

vmware-vdi's Issues

Unable to run few PS1 scripts

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]
    
  •     ~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : NullArray

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]
    
  •     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : InvokeMethodOnNull

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)) {
    
  •                   ~~~~~~~~~
    
    • CategoryInfo : WriteError: (:) [Get-Date], ParameterBindingException
    • FullyQualifiedErrorId : ParameterBindingFailed,Microsoft.PowerShell.Commands.GetDateCommand

Cannot index into a null array.
At C:\Users\anupcp\Desktop\vmware-vdi-master\scripts\vmUsers.ps1:27 char:3

  •     $line = $content[$i]
    
  •     ~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : NullArray

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]
    
  •     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : InvokeMethodOnNull

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)) {
    
  •                   ~~~~~~~~~
    
    • CategoryInfo : WriteError: (:) [Get-Date], ParameterBindingException
    • FullyQualifiedErrorId : ParameterBindingFailed,Microsoft.PowerShell.Commands.GetDateCommand

    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
    
  •         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : ObjectNotFound: (vmware.view.pow...ts.GetDesktopVM:GetDesktopVM) [Get-DesktopVM], Ex
      ion
    • FullyQualifiedErrorId : No object,vmware.view.powershell.cmdlets.GetDesktopVM

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
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (op_Addition:String) [], RuntimeException
    • FullyQualifiedErrorId : MethodNotFound

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
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (op_Addition:String) [], RuntimeException
    • FullyQualifiedErrorId : MethodNotFound

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 ...
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (op_Addition:String) [], RuntimeException
    • FullyQualifiedErrorId : MethodNotFound

    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
    
  •           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : SecurityError: (:) [], PSSecurityException
    • FullyQualifiedErrorId : UnauthorizedAccess
      & : 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
    
  •           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : SecurityError: (:) [], PSSecurityException
    • FullyQualifiedErrorId : UnauthorizedAccess
      & : 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
    
  •           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : SecurityError: (:) [], PSSecurityException
    • FullyQualifiedErrorId : UnauthorizedAccess
      & : 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
    
  •           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : SecurityError: (:) [], PSSecurityException
    • FullyQualifiedErrorId : UnauthorizedAccess
      & : 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
    
  •           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : SecurityError: (:) [], PSSecurityException
    • FullyQualifiedErrorId : UnauthorizedAccess

    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

  • ... teAndUser = Get-Content "$usageFileLocation$file" Select-String -NotM ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidArgument: (:) [Get-Content], ParameterBindingException
    • FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.GetContentCommand

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 ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidArgument: (:) [Get-Content], ParameterBindingException
    • FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.GetContentCommand

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 ...

  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidArgument: (:) [Get-Content], ParameterBindingException
    • FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.GetContentCommand

    Any help would be much appreicated.

    Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.