Code Monkey home page Code Monkey logo

powershell-vmware's Introduction

Powershell-VMware

Powershell or PowerCLI modules for VMware administration/troubleshooting tasks

powershell-vmware's People

Contributors

mathieubuisson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

powershell-vmware's Issues

Add-PSSnapin VMware.VimAutomation.Core

On line 102 of Get-StoreageViewsReport, you run this if statement:
If(-not (Get-PSSnapin VMware.VimAutomation.Core -ErrorAction SilentlyContinue)) {
Add-PSSnapin VMware.VimAutomation.Core }

For some reason, at least on machines in my environment, this snapin doesn't show as loaded, but when attempting to load it, an error is reported, stating that "an item with the same key has already been added."

The snapins that are loaded for me are
Microsoft.PowerShell.Core
VMware.VimAutomation.License
VMware.DeployAutomation
VMware.ImageBuilder

Strong Typing Disallows Certain Datastore Types

On line 89 of Get-StorageViewsReport.psm1, you give the variable $Datastore a type of
[VMware.VimAutomation.ViCore.Impl.V1.DatastoreManagement.VmfsDatastoreImpl[]]

For vmWare configurations where the type NasDatastoreImpl is also used, your code fails.
If you don't explicitly declare the type of this variable, the code works for both types.

hello M BUISSON

Hello M BUISSON,
First excuse for my English i m french.
I'm using your script Get-StorageViewsReport.psm1 to getting a snapshot state for every VM in our VCENTER and we send the result by mail.
All is working fine since several years and i must thanks you for you work and sharing you knowledge.

The problem is that we have create a new DATA CENTER in our VCENTER console with a new CLUSTER inside.
And now the script you developped is no more working
. I try to find why but my knowledge are limited

clust

below the command that we use and that was working fine before creating the 2de Datacenter/cluster

#collect vm snaphot info to text file verifsnapshot.txt
Get-VM | Get-StorageViewsReport | Sort-Object -Property VM | Format-Table -auto | out-file C:\Users\administrateur\Desktop\snapshot_report\verifsnaphot.txt -encoding UTF8 -width 100

The error is probably a problem with the datastore Type (NAS -NFS simplivity) for the second cluster we have created
nas

thanks if you could have time to see why you script is no more working with this new Datastore in NAS type
(I have tested the last version of your script after you patched it for NAS support but it dontt work too)
Thanks


Finally when i suppress the code below (by datastore option) because i d'ont use it i use by-vm (get-vm)
it works.
old version script** don't works like say drockwood94 22 jull 2015 in old comment
**[Parameter(ParameterSetName='ByDatastore')]
[switch]$ByDatastore,

    [Parameter(ValueFromPipeline = $True,
    ParameterSetName='ByDatastore',
    ValueFromPipelineByPropertyName=$True,Position=0)]   
    [VMware.VimAutomation.ViCore.Impl.V1.DatastoreManagement.VmfsDatastoreImpl[]]$Datastore = (Get-Datastore),**

******** in your patched code i have to suppress this code below too**** to works
[Parameter(ParameterSetName='ByDatastore')]
84 [switch]$ByDatastore,
85

86 [Parameter(ValueFromPipeline = $True,
87 ParameterSetName='ByDatastore',
88 ValueFromPipelineByPropertyName=$True,Position=0)]
89 [ValidateScript({ $[0] -is [VMware.VimAutomation.ViCore.Impl.V1.DatastoreManagement.VmfsDatastoreImpl] -or $[0] -is [VMware.VimAutomation.ViCore.Impl.V1.DatastoreManagement.NasDatastoreImpl] })]
90 $Datastore = (Get-Datastore),

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.