Why isn't this declare variable work?

I'm trying but the construction of a host (read from $dest) in a variable called $desthostbuild.

It displays on the screen correctly returning this

Build: 143128

but $desthostbuild remains empty.

I'm hoping to use it as part of a script that will move a virtual machine to a host, and then upgrade the tools if the build number of the host is higher than the version number of the tools in the comments.

What I am doing wrong?

Function Get-HostBuild {}

Get-vmhost $dest | % {$server = $_______ | get - view; $server.} Config.Product | Select Build}

}

$desthostbuild = (get-HostBuild | fl *)

I think it will be easier if you create a similar function to get the version of the tools for a guest.

Since both functions return a string you can as well use the operator - eq

Something like this for example

function Get-HostBuild {
     param ([string]$hostname)
     (Get-VMHost $hostname | Get-View).Config.Product.Build
}

function Get-ToolsVersion {
     param ([string]$vmname)
     (get-vm $vmname | get-view).config.tools.toolsVersion
}

$dest = 
$a = get-hostbuild $dest
$vm = 
$b = get-toolsversion $vm
if ($a -eq $b) {Write-Host "Tools version OK"}
else {Write-Host "Tools need upgrade"}

Tags: VMware

Similar Questions

  • Why isn't 'if the variable does not equal null"work?

    Pretty simple thing, I thought, but it drives me batty...

    The Captivate 8.

    I have a widget for checkbox and assigned variables to all 6 boxes (framework1, evaluation2... assessment6). I also have a variable called 'null' (thanks to lilybiri). The variable has no value for her.


    So, I in my Advanced actions:


    If assessment1 is not equal to v_null or

    If evaluation2 does not equal v_null or

    If assessmen3 is not equal to v_null

    Le n

    See submit it (button)


    That means that if no the framework1, 2 or 3 etc... are verified, the assessment variables will be 'something' and not 'null' and should trigger showing button, but it does not work...


    Any ideas?


    Thank you!


    Sorry, I give up. You seem not to understand that you need another approach. Especially your answer 1 is not correct, why has the right of v_none, you are not in the mind of the person who checked it? 2 you give the opposite, what happens if the user has archived v_none really because he won't? Anywat that it is not possible to verify this with a single action advanced conditional with two decisions, because the sequence needs to be reversed for the second situation compared with the first situation. Everything should be in a single decision, with THEN/ELSE, but I do not understand the logic, so you can not help.

  • Why isn't my check spelling work?

    Hi guys,.

    Since the last update of Mozilla version 23.0 my spelling check is no longer in effect. I seem to be miss-written every word, because each of them are noteworthy.

    How can I solve this problem? I don't want to change to another browser of crap just because I can't use an add-on check spelling...

    As a side note, all that worked on version 22, and I don't understand why it isn't now. I just want to see this problem, please help? Thanks in advance.

    I had the same problem and solved it by uninstalling Firefox 23 and all its data and downgrade to Firefox 22. Now the spell checking works properly!
    If a developer is reading this, please see the question. My computer has 64-bit Windows 8.

    NOTE
    Apparently, this problem was caused by a Firefox bug which has been fixed in Firefox 23.1 the nature of the problem is such that no English installs was more likely to be affected.
    My post under gives more information.

    Users should not have this problem now, or if you do, then it is likely to be another cause. So please start a new question of your own using the link standard/issues/new/firefox

    Updated by a Forum Mod ~ J99 1st edition updated November 30, 2013 at 9:39:28 AM GMT by John99

    2nd edition.
    This issue of ws Fx22-3 change of link ordinary link

  • Why does'nt this new version works with Norton worm 6? My old version of Firefox is!

    My old version of Firefox worked perfectly with Norton Antivirus Version 6 just bought. I have updated to you application to the new version of Firefox, which now claims I have 5.5 Norton which is not supported. It makes no sense at all. My secure connections and auto password doesn't work anymore and I want that protection through Norton. Please advise me.

    Symantec needs update their Firefox Add-ons to make them compatible with Firefox 4. They indicated that, for Norton 360, they plan to release a update of Norton 360 to support Firefox 4 in early may - http://us.norton.com/support/kb/web_view.jsp?wv_type=public_web & docurl = 20100720113635EN & ln = en_US

    I don't know about the time scale for the updates for other Norton products. Waiting for the update by Symantec, if you want to use Norton modules, you will need to downgrade to Firefox 3.6.

    Downgrade to Firefox 3.6 first of all uninstall Firefox 4, but do not select the option 'remove my Firefox personal data '. If you select this option, it will delete your bookmarks, passwords and other user data.

    Then you can install the latest version of Firefox 3.6 available to http://www.mozilla.com/en-US/firefox/all-older.html - it will automatically use your favorite courses, passwords etc.

    I recommend, to avoid possible problems with decommissioning, accessing your profile folder and delete the following files if they exist - extensions.cache, extensions.rdf, extensions.ini, extensions.sqlite and localstore.rdf. Delete these files will force Firefox to rebuild the list of installed extensions, check their compatibility and cancel the toolbar customizations.

    For more information on how to find your profile folder, see https://support.mozilla.com/kb/Profiles

  • Why isn't "save under" to work in Word for Mac?

    Am on OS X El Capitan and using Microsoft Word for Mac version 15.25.

    When I try to "Save as" to put a copy in a different folder, nothing happens.

    on earlier versions of MSO for OS X saves initial may not be "save under...". ", subsequent cases can be" save under... ". "once the file is saved normally.

  • Why isn't there any help from this pile of garbage they don't really a?

    Why isn't there any help from this pile of garbage they don't really a?  ????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????

    I'm not sure that they have a web presence or are accessible by modern tools of communication such as cell phones. You may have to go there yourself, explain your situation and ask for advice. However, I suspect those of Delphi, Greese may not appreciate mount Parnassus, being called a "bunch of garbage." Nevertheless, I think it might be useful to ask the help of the oracle of Delphi, despite this potential problem.

    Now remove language cheek to say,

    Good luck.

    Tom Ferguson

  • Why isn't my Windows Update Agent update to version 7.6.7600.256 as KB949104 says it should?

    OS: Windows XP Professional SP3

    They have recently tightened the Windows UPDATE agent to treat the virus of the flame by the update to version 7.6.7600.256.

    Of KB949104...

    -------------------------------------------------------------------------------------------------------------------
    How to obtain the latest Windows Update Agent if Windows Update or the automatic updates is enabled, the latest version of the Windows Update Agent will be automatically downloaded and installed on your computer. If you go to Windows Update until it is installed automatically, you will see a message to install the Windows Update Agent:
    -------------------------------------------------------------------------------------------------------------------

    I visited Windows Update et.256 is not available. I currently have 7.4.7600.226.

    I also did an experience in a virtual XP machine:
    I drove in arriere.226 to what comes of the actions on XP SP3 and WU then visited. 226, which was not installed pas.256.

    I also have a Windows 7 running in a virtual machine and one notices not to come through, but this guy doesn't.

    Also, why isn't the redistributable not offered by download? Those of us who do CDs unattended need.

    -------------------------------------------------------------------------------------------------------------------
    There is no stand-alone installer for the latest version of the Windows Update Agent (7.6.7600.256). Here are instructions on how to get the version of the Windows Update Agent 7.4.7600.226.

    -------------------------------------------------------------------------------------------------------------------

    Of http://support.microsoft.com/kb/946928

    Looks like they finally leave the valves on that. My Google for the keyword 7.6.7600.256 alerts has been non-stop for the last 24 hours. All my systems to update recently.

    I really doubt that they were not shut down at the same time to lighten the load on the servers since a patch work Tuesday them probably 1 million fold more difficult.

  • How to declare variables in PL/SQL (dynamically)

    Hello

    Please inform me how can I declare variables in PL/SQL dynamically (I want used in other projects). I tried the following code, but this error

    SQL > /.
    declare
    *
    ERROR on line 1:
    ORA-06550: line 1, column 74:
    PL/SQL: ORA-00933: SQL not correctly completed command
    ORA-06550: line 1, column 35:
    PL/SQL: SQL statement ignored
    ORA-06512: at line 10

    -----------------------------------------
    This is the code.
    declare
    v_temp varchar2 (300);
    x varchar2 (20);
    y varchar2 (20);

    Start
    BBB: = "X varchar2 (20);"
    y : = '1' ;

    run immediately 'declare '.
    || v_temp
    || "start."
    || 'Select name '.
    || "Ali where id =: yy '.
    || ' x using the ' | There
    || ' ; '
    || ' end; ';
    end;

    concerning
    WAel

    user3098640 wrote:
    Hi, thanks a lot for all. OK I'll show you that I want to achieve. So please help me
    refer to the following table it consist of four columns and three rows.
    I only want to show the column that has a value of ZERO : like the following query

    Select REC1 IMAGE_VALUE where corr = 'x' and rec1 = '1';

    Do you want that ZERO or '1 '? Contradict you yourself.

    Good to see you're requirements are clear.

    in this case are easy, but in my case the columns may be more than 100 columns (this is will automatically create - already made the number of columns is not fixed but it start by REC1 REC2, REC3, REC4... etc)
    the question is How can I DISPLAY the columns containing only '1' for specfic "corr" is X, Y or Z in PL - SQL

    Why you have a table that automatically creates with an unknown number of columns?
    It of very bad database design and get the basics of the design by the window completely.

    When you say 'Show' to what it means? SQL and PL/SQL "shows" nothing, because it has no user interface. It simply processes the data, and if these data are not in a known structure at the time where the application has been designed, and all code must be dynamic to try to deal with it. It is simply false in many ways.

    A better structure would be something like this...

    SQL> create table image_value (corr varchar2(20), rec varchar2(10), rec_val varchar2(20));
    
    Table created.
    
    SQL>
    SQL> insert into image_value (corr, rec, rec_val) values ('X','REC1','1');
    
    1 row created.
    
    SQL> insert into image_value (corr, rec, rec_val) values ('X','REC2','0');
    
    1 row created.
    
    SQL> insert into image_value (corr, rec, rec_val) values ('X','REC3','0');
    
    1 row created.
    
    SQL> insert into image_value (corr, rec, rec_val) values ('Y','REC1','0');
    
    1 row created.
    
    SQL> insert into image_value (corr, rec, rec_val) values ('Y','REC2','1');
    
    1 row created.
    
    SQL> insert into image_value (corr, rec, rec_val) values ('Y','REC3','1');
    
    1 row created.
    
    SQL> insert into image_value (corr, rec, rec_val) values ('Z','REC1','1');
    
    1 row created.
    
    SQL> insert into image_value (corr, rec, rec_val) values ('Z','REC2','0');
    
    1 row created.
    
    SQL> insert into image_value (corr, rec, rec_val) values ('Z','REC3','1');
    
    1 row created.
    
    SQL>
    SQL> commit;
    
    Commit complete.
    
    SQL>
    SQL> with r as (select '&Required_Corr' as req_corr from dual)
      2  --
      3  -- end of input
      4  --
      5  select corr
      6        ,max(decode(rn,1,rec)) as c1
      7        ,max(decode(rn,2,rec)) as c2
      8        ,max(decode(rn,3,rec)) as c3
      9        ,max(decode(rn,4,rec)) as c4
     10        ,max(decode(rn,5,rec)) as c5
     11        ,max(decode(rn,6,rec)) as c6
     12        ,max(decode(rn,7,rec)) as c7
     13        ,max(decode(rn,8,rec)) as c8
     14        ,max(decode(rn,9,rec)) as c9
     15        ,max(decode(rn,10,rec)) as c10
     16  from (
     17        select corr, rec, row_number() over (partition by corr order by rec) as rn
     18        from   image_value, r
     19        where  corr = req_corr
     20        and    rec_val = '1'
     21       )
     22  group by corr;
    Enter value for required_corr: X
    old   1: with r as (select '&Required_Corr' as req_corr from dual)
    new   1: with r as (select 'X' as req_corr from dual)
    
    CORR                 C1         C2         C3         C4         C5         C6         C7         C8         C9         C10
    -------------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
    X                    REC1
    
    SQL> /
    Enter value for required_corr: Y
    old   1: with r as (select '&Required_Corr' as req_corr from dual)
    new   1: with r as (select 'Y' as req_corr from dual)
    
    CORR                 C1         C2         C3         C4         C5         C6         C7         C8         C9         C10
    -------------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
    Y                    REC2       REC3
    
    SQL> /
    Enter value for required_corr: Z
    old   1: with r as (select '&Required_Corr' as req_corr from dual)
    new   1: with r as (select 'Z' as req_corr from dual)
    
    CORR                 C1         C2         C3         C4         C5         C6         C7         C8         C9         C10
    -------------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
    Z                    REC1       REC3
    
    SQL>
    

    And you support the maximum number of values REC you expect.

    Other than that, what you're really talking is a reporting requirement that requires that the data to be read once before, it is then processed and only the required data is queried with a second query. This can be done in PL/SQL using DBMS_SQL (or versions using EXECUTE IMMEDIATE), but really, that should be done by tools that are designed to query data then format and place based on the content of the reporting data.

    Yet, you have not really explained why you are trying to do. It's alright saying you are trying to achieve, but which does not justify as being the right way to do things. What you have shown us so far, is not how to design a database or application code.

  • Why not update for Linux mechanism works?

    Firefox informed me this morning that an update was available. In the small window in which this information came, there was a button marked "Update Now". I pressed the button and showed a gray horizontal bar with a short dark color bar moving from left to right. The text in the window says that Firefox has been updated. Unfortunately, that "update" can go on forever with nothing to show for it. So finally, I have to close the window myself (using the window manager).

    So my question is: why the update mechanism does not work for Linux?

    You have write rights to the Firefox installation folder?

    You are using a Firefox installation from the repositories of your Linux distribution or you installed Firefox yourself?

    If you used the deposits then you need to update via your software management.

    Otherwise, you may need to be updated as long as user root.

  • Why the alt tag does not work in firefox to open a description of an image on mouseover

    In IE, when I ride my mosue over an image, it gives a description of the ToolTip of the image contained in the html alt tag. Why this does not work in Firefox?

  • Why isn't my direct picture move?

    Why isn't my direct picture move?

    Hi there, visit this link

    http://iphonephotographyschool.com/live-photos/

    also, if you change a live picture, it won't play, make sure your 3D touch is enabled and when you take a picture if ensure you enable this Sun logo in the built-in camera application

  • Hello. Why isn't the new version of Firefox, taken care of by the Google toolbar? The translation was so convenient and I tried google translate lite, but it's not as convenient. Thank you.

    Hello. Why isn't the new version of Firefox, taken care of by the Google toolbar? The translation was so convenient and I tried google translate lite, but it's not as convenient. Thank you.

    Please click the button solved it next to the answer that solved your problem of Firefox support, it appears when you are connected, so this thread is marked as resolved to help other users who may have this same problem.

  • Why the command/tab does not work in the new discourse during a presentation

    Why the command/tab doesn't work with Keynote 6.6.1 during a presentation.  I can't get out (smoothly and professionally) presentation for applications that run in the background, then return smoothly.  Slows down my presentation, seems unprofessional.  This key combination worked very well until I used the new version of Keynote.

    We have no problem with the service application switcher using Yosemite and Keynote 6.6.1 on any of our client systems, or there is no record of anyone having this problem on the discussions.

    This sounds like a problem of systems;

    • what amount of RAM is installed
    • What is the amount of free space on the boot volume
    • have you antivirus, security and cleaning of installed applications
    • emptied the Recycle Bin
    • is the clear office of files and folders
  • Why some AVI format doesn't work properly with IMAQ?

    I tried to do a job with handling the AVI files in labeled, but it seems that mine will not work. Whenever I try to load, I get the error:

    Error 1074396005 has occurred to IMAQ AVI2 close

    Possible reasons:

    IMAQ Vision: Session invalid AVI.

    What is strange, is that some AVI files will be read fine. If someone could explain why I see this error or how to convert my AVI files to the correct version, I would be happy. I have attached two files. The touchdown, one will not work. The ball marked a will.


  • Why I get this: VISA: (Hex 0xBFFF00A5) interface type is valid, but the number of specified interface is not configured.

    I searched the knowledge base NOT found Document ID: 5389BHR7. I went through the 'solution', but I already had NiVi488.dll - NI-VISA passport to the GPIB controlled. I can't find anything else on the matter. Any help would be appreciated.

    Note: this deployment has worked in the past. I upgraded from LV2009 to LV2013 last year and this is the first run my Installer on a new PC since the upgrade. I have all my VI migrated to the format of 2013. A PC running all my previous VI has been upgraded, but I did was install the runtime in 2013 and then copied all the new .exe. They all work. I imported my hardware configuration as part of the installation process.

    I found the solution. I had taken off my VISA Alias names and had the GPIB::6:INST because I had problems with a version of the VISA. This has been resolved once I got an appropriate VISA version installed. Now, this VISA was installed proplerly, I actually had to give a 'name' for each piece of equipment. This is why the error "interface number specified is not configured" message. Once I reassigned all instruments VISA on my GPIB bus with a name, everything started working again.

Maybe you are looking for

  • Can I change the login email address?

    When I initially set up my Mac Pro, I used my google e-mail address as my internet cable connection.  Now, I want to change that, so I can use my mac address.  How can I change this initial login e-mail address?

  • Can't get into BIOS after the use of "Quick start" mode

    Hello I do things1 - Enter my BIOS"' Quick start of start 2-change of speed to.Then I restart my knees and Toshiba logo disappeared. I want to get into my BIOS again, but howI tried F2, F12 and del not question Please help me

  • 08/04/2007 Nugget Motors Community action

  • My computer does not recognize my speakers...

    I have a desktop Pavilion with Windows 7. Several months ago, I bought a speakers 'Bose Companion 5' system, which is compatible with Windows 7. It worked beautifully until about four weeks when all of a sudden the computer decides that she does not

  • How do I turn on the Flash

    Hi everyone, I am looking for a solution for 2 days and I can not solve the problem. I am trying to turn on the flash on my camera, a 9700, but nothing happens. Can you help me? /** * HelloWorld.java * * Copyright © 1998-2010 Research In Motion Ltd.