Why don't $vm-"VirtualMachineImpl" is not working?

In PowerShell, you can use the - is operator to check a variable type. For example:

$array = @)

$array - is 'array '.


Returns the value True.

However if I try:

$vm = get-VM-name "MyVM.

$vm - is 'VirtualMachineImpl '.


I get the error message:

Impossible to convert the value of 'VirtualMachineImpl' to type 'System.String' type 'System.Type.
On line: 1 char: 1
+ $vm - is 'VirtualMachineImpl '.
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo: NotSpecified: (:)) [], RuntimeException)
+ FullyQualifiedErrorId: RuntimeException


I know that I can use:

$vm. GetType(). Name - eq "VirtualMachineImpl".


instead of the - is operator. But I'm just curious as to why the - is operator works for the basic types of PowerShell and not for the PowerCLI types.

Does anyone have an idea?

Best regards, Robert

This is because there is no PS accelerators for PowerCLI types.

You can see the accelerators of PS builtin (Keith Hill code)

$acceleratorsType = [type]::gettype("System.Management.Automation.TypeAccelerators")
$acceleratorsType::Add("accelerators", $acceleratorsType)
[accelerators]::Get

And you can manage your own accelerators.

See Jaykul functions.

Tags: VMware

Similar Questions

  • Why my php export feature does not work in IE and not firefox?

    Why my php export feature does not work in IE and not Firefox? I wrote a web application that contains a SigmaGrid. Grid controls reload, add update delete, print and export to CSV all work in IE8. The export function does not work in Firefox.

    Have you tried to test your application on IE7/8/9 and FF10/Chrome/Opera?

  • Why the Polish support page does not work?

    Why the Polish support page does not work?

    http://PL.consumer.Toshiba.EU/PL/support/home/support_home?

    I think the error message is pretty clear:

    + Service temporarily unavailable +.
    + The server is temporarily unable to process your request due to downtime or maintenance capacity problems. Please try again later. +

  • Does anyone know any reason why my photoshop 3D CC does not work. Cannot highlight the functions, as are gray. I Lion 10.7.5 but all other functions seem to work. ?

    Does anyone know any reason why my photoshop 3D CC does not work. Cannot highlight the functions, as are gray. I Lion 10.7.5 but all other functions seem to work. ?

    upgrade your operating system, Photoshop system requirements

  • Why don't the apps invented not in my "Apps" section in the creative clouds?

    Why don't the apps invented not in my "Apps" section in the creative clouds?

    Hello

    Please help us to better understand.

    Do you get a spinning wheel under the apps section?

    Please follow-

    Adobe Creative Cloud desktop application does not open or shows a spinning wheel of progress

    Can not see my apps in cloud creative, just a spining wheel

    Is it a mistake to download apps?

    Please follow:

    Using creative cloud | Download error in the applications tab of Creative Cloud Desktop Application

    Hope this helps!

  • Why the button "Save as" does not work in new Acrobat Reader? Very annoying...

    Why the button "Save as" does not work in new Acrobat Reader? Very annoying...

    I have already updated to the last DC v15.009.20077...

    So I found a way, if I do it just right, it works (with the file, click the "tiny" file and then save as. I made the mistake of first pressing the home much more first. Really not intuitive or easy to use even if... Looks like you have replaced the button "save under" with the "save in the cloud." We use mettle at work, and the cloud of Adobe is irrelevant for me...

  • Why the "vertical-align" argument does not work?

    Very often, I try to use the "vertical-align" argument to control the CSS formatting, but so far he has never worked, so I had to resolve the situation by specifying values for margin...

    Why the "vertical-align" argument does not work in CSS?

    Alternatives?

    For your reading pleasure.

    http://phrogz.NET/CSS/vertical-align/index.html

    Gary

  • Why my brushes on CS5 does not work?

    Why my brushes cs5 does not work? I have a Pentium clocked at 2.7 GHz Duo Core 4Ram computer. all the brushes but the brushes work... My wife's computer can use them but mine does not.  Siena is a windows vista 2 GHz 4 core duo ram.2010-11-13_1937.jpg

    I found online a simular with another mistake, but they didn't get enabled.  can help you or know a program that can afford ELP paintbrushes?

    I don't know exactly why it crashes, but the crash is in your NVidia OpenGL driver.

    You can try to disable OpenGL drawing in Photoshop at the moment.

    But you should check for updated drivers and possibly contact NVidia if they haven't fixed the bug yet.

  • Why this simple script script does not work

    I'm pretty new to actionscript, I have learned from books, in fact I still am.

    The script that I'll try to work on my site, worked well in the teachings of the books.

    I don't think that my buttons are different, but why don't they work then.

    Can someone figure this.

    my script:

    Stop();

    whoweare.addEventListener (MouseEvent.MOUSE_UP, onNavigate);

    function onNavigate (evt:MouseEvent): Void {}
    gotoAndPlay ("contact");
    }

    whatwedo.addEventListener (MouseEvent.MOUSE_UP, onNavigate);

    function onNavigate (evt:MouseEvent): Void {}
    gotoAndPlay ("slideshow");
    }

    Error: the class or interface 'MouseEvent' could not be loaded.

    Help?

    Dirkhou,

    void not Void in AS3

  • Why used the search box does not work

    the mag glass has a green more than and the research of features do not work at all I've tried everything I can find no answer please don't help

    Plu green indicates that the current site has a search plugin, you can install it if you want. Without doubt, who is not related to the problem.

    You are having problems with the search bar on the right end of the toolbar or from the search box in one of the internal pages of Firefox, for example the integrated home page or the new tab page?

    With the search in the toolbar bar, normally, as soon as you start typing, or if you click it with the text already in it, the button panel descends. What is happening? While you type there may be suggestions for your default search engine. You get? And finally to search you can press enter or click on the arrow. No results?

  • Why the keyboard shortcuts/function does not work on Satellite Pro A200?

    I did some research for almost two hours now and no solution.

    I want to do is to be able to use the Fn key for shortcut keys the F0 - F12 Fn + ESC to mute the sound, or button Fn + F6/F7 to set the brightness on my screen. I am running Windows XP, these information are necessary. Things I've tried so far was installing utilities Toshiba, such as the Fn-accessibility and Fn-esse, but they still do not work.

    I have no idea why they have not worked since I arrived to my laptop. Help, please! Thank you!!!

    In the history of the most important info is missing: what model of laptop do you have?
    Please send the exact model number.

  • Why the media control buttons do not work

    my computer is a toshiba M300 series

    Hi manumartinez,
     
    -The multimedia keys worked without any problems before?
    -If Yes, what is the recent change that was made on your computer after that this problem started to happen?
     
    Follow the suggestion given in the link below and check if it helps you to fix the problem:
     
    If this does not work, contact Toshiba support for assistance on this issue.
  • Why the button new folder does not work

    the button create a new folder does not work

    Hello

    You have a common problem with Windows 7. The work that I and many others use is a utility called FileMenu Tools. You can download safely from this link: http://www.softpedia.com/get/PORTABLE-SOFTWARE/System/System-Enhancements/FileMenu-Tools-Portable.shtml .

    After downloading, install the program. Each option is checked by default. I would be much more selective on this subject, otherwise your context menu will be a full page long! When the main window opens, you will see a list on the right side of all the elements that can be added to the context menu. Start weeding through the list and every one to take away, you don't need the United Nationsby checking the box.

    Once you have completed your selection (de-selections) make sure that you click the green check mark in the row of icons at the top of the left window of the interface to 'Apply' of your choice. The program can do much more, but that answers your specific question. I am told that the program has a good help file, so try here if you are interested.

    Let me know how you fare.

    Kind regards

    BearPup

  • Why Twitter's Web site is not working properly; for example, the list drop-down settings?

    Many links on Twitter's Web site do not work in Firefox for Mac OS. For example, the 'gear' at the top of the page icon will not produce a drop-down menu so that I can disconnect. Instead, clicking on it sometimes produces basic account settings, but nothing else. The button "Compose a new Tweet" does nothing.

    I gave permission to Twitter to do anything and everything under "subject: permissions. I deleted all cookies on Twitter about the possibility that one of them has been altered. I can log into the twitter website and see other tweets.

    I'm running the most recent versions of the operating system Mac and Firefox and am not having problems with other sites I visit.

    Hello

    The reset Firefox feature can solve a lot of problems in restaurant Firefox to its factory default condition while saving your vital information.

    Note: This will make you lose all the Extensions, open Web sites and preferences.

    To reset Firefox, perform the following steps:

    1. Go to Firefox > help > troubleshooting information.
    2. Click on the button 'Reset Firefox'.
    3. Firefox will close and reset. After Firefox is finished, it will display a window with the imported information. Click Finish.
    4. Firefox opens with all the default settings applied.

    Information can be found in the article Firefox Refresh - reset the settings and Add-ons .

    This solve your problems? Please report to us!

    Thank you.

  • Why showtime anytime and hbogo does not work on the frontier Fios?

    Showtime at all times & HBOGO not working only not on the frontier Fios?

    Welcome to the Apple community.

    If it's only at the border, it would seem that the best people to ask would be Frontier Communications.

Maybe you are looking for