Try to resize C:\ on preproduction servers that are less than 59 GB using several Where-Object checks

Hi people

Im trying to increase all disks C:\ of different sizes for a uniform 60 GB.

I found a thread in this community that attempts to automate it as follows:

Get-hard drive - vm "my VM | where {$_.} Name - eq 'disk 1'} | Together-hard drive - CapacityGB 60 - ResizeGuestPartition-confirm: $false

To confirm, the command works but the ResizeGuestPartition does not work, so I need to automate this later.

For now the key is to get this working and it does not appear:

Get-VM-Tag "preproduction" | Where-Object {$_.} Guest.OSFullName - like ' * Windows Server * "- and $_. PowerState - eq 'Receptor' - and ($_.) Guest.Disks.Path - eq "C:\". "- and $_. Guest.Disks.CapacityGB - lt 59)}

Im trying to figure out how to use a hash table / script block to tell if the disc is "C:\". "and the size of this drive is less than 59 GB, then resize the disk. Before I resize the disks, I need to validate the im servers get back are indeed correct - for the moment, they are not as I checked inspected these variables manually through PowerGUI (excellent by the way).

Even if I'm just trying to Get-VM-Tag "preproduction" | Where-Object {$_.} Guest.Disks.Path - eq "C:\". "- and $_. Guest.Disks.CapacityGB - lt 59} the result does not work and I think that its because it detects all the disks and then said there is at least one drive which is equal to "C:\". "and at least a drive that is less"Go 59 -"but I need it to be the same disk not different disks for obvious reasons, otherwise the result will always be wrong.

LucD im sure you meet a reading, I would really appreciate your help

Im trying to start searching for a cleaner steamer so that I don't have to run several lines of code to achieve the same.

Much appreciated,

Mike

Try like this

Get-VM-Tag "preproduction" |

Where-Object {$_.} Guest.OSFullName - like ' * Windows Server * '- and

$_. PowerState - eq 'Receptor' - and

(($_. Guest.Disks | where {$_.} Path - eq "C:\". »}). (CapacityGB-le 59)} |

Select name

Tags: VMware

Similar Questions

  • I want to continue to use my current Vista operating system, but I forgot to turn it off before changing the parts of my PC. Now, whenever I try to turn it on, it says that the license is already in use.

    Transfer of license with a twist

    So I've recently upgraded to a new system... Virtually everything has been replaced - the motherboard, RAM, graphics card, processor... Everything but my HARD drive. I want to continue to use my current Vista operating system, but I forgot to turn it off before changing the parts of my PC. Now, whenever I try to turn it on, it says that the license is already in use.

    Is there anyway for me to be able to turn it on for my new rig? Thank you.

    If you have a retail copy of Vista, you must activate by phone.  Click Start, type "slui 4" and press ENTER.

    See http://support.microsoft.com/kb/940315

    If your copy of Vista is preinstalled on your computer, you can't use it with the new motherboard and you will need to purchase a copy of the license full of Windows.  Most of the editions of Vista out of support in two months so consider Windows 7.

  • VCM can manage servers that are not member of a domain?

    We have several stand-alone servers that are not members of the Unix and Windows domain, how can they be added to the VCM and managed? For Windows, I think that the option is to choose the "Workgroup" field, but I'm lost on Unix servers.

    Under Windows, you can use the HTTP agent requiring not assigned credentials (the agent runs as Local System), or you can use a local account. or the name of the computer in the domain name.

    For UNIX/Linux, no assigned credentials is always required. The agent creates a local user at the time of the installation account and authenticate the collector based on its certificate.

  • How do a print size customized to be larger than 8 X 10 to fit Sublimation printing on the metal blanks that are exactly 8 X 10 using PES 11 windows 7 with an Epsom 1430 printer?

    How to do a print size customized to be larger than 8 X 10 to fit to print in Sublimation on the blanks of metal that are exactly 8 X 10 using the PES 11, windows 7 with an Epsom 1430 printer? We need the size slightly larger to fit.

    Sounds like a contradiction. Try the elements Photoshop Elements forum

  • Smartphones blackBerry calendar deletes appointments that are older than two months.

    Hello.  I'm sorry if this has been posted elsewhere, but I search and did not find an answer.  My calendar on Blackberry and Outlook is the erasure of the appointments that are older than two months.  Appointments to the breast to aim for two months and the future demand are very good.  Is there a setting that I can change in the Blackberry or Outlook calendar to avoid this problem or is it a problem of memory?  Thanks in advance.

    On your BB > opens the calendar > Menu > Options > General Options (if there is a general options, some versions go directly to the screen > scroll down to 'Keep the appointments' and the value you want length.)

  • Shades that are more than 100%

    In the FrameMaker color Definitions dialog box, if you choose print as: hue, the Tint slider goes from zero to 100%. However, it is possible to enter a percentage for hue that is greater than 100%, for example 120% and FrameMaker save it the tint. Is this a bug in the program?

    I just tried FM12 and FM2015 and see the same (return to 100%) behaviors. What point of FM12 version do you use?

  • Dealing with models that require LESS than CSS compilation

    I noticed a lot of CMS templates/themes recent work with files UNDER that cancels the changes to the CSS files. I think it of a pain that I'm used to make changes throughout the different CSS files and done with it. With the introduction of LESS, however, I find it more difficult to make these changes 'stick '.

    Did someone else came with a simple workflow to customize the models using LESS? In general, I do not create custom CSS files etc.

    I place all my files, as well as all JavaScript files in a subdirectory named _src (for the source files). The _scr folder is hidden so that it is not included in the transfer of files. The structure resembles

    _src

    JS

    bootstrap

    ... / / files go here

    fonts

    ... / / files go here

    jQuery

    ... / / files go here

    myScripts.js / / scripts of myself I want to added

    scripts.js / / contains files imported JS that are combined and minimized production in script

    less

    bootstrap

    ... / / files go here

    fonts

    ... / / files go here

    footer.less / /.

    Form.less / /.

    Header.less / / these files are for different parts of the model and or documents

    main.less / /.

    NAV.less / /.

    styles.less / / contains LESS imported files that are combined and minimized in the style sheet production

    I will then use PrePros to compile the JS and CSS files for only two HTTP requests.

    Take a look at the source code (lines 7 and 110) for this site.

    Either way, using PrePros, not only do the LEAST and JS files get compiled automatically, all saved changes are immediately visible in my browser without having to update each time.

  • Selection of records that are greater than the current week or

    Hi I have a table with the table structure

    CREATE TABLE OMPPRODUCTION
    (
    LOCATIONID VARCHAR2 (200 BYTE) NOT NULL,
    IPC VARCHAR2 (200 BYTE) NOT NULL,
    PRODUCTIONWEEK VARCHAR2 (200 BYTE) NOT NULL,
    QUANTITY VARCHAR2 (2000 BYTE),
    PRODUCTIONCODE VARCHAR2 (2000 BYTE),
    MOULDQUANTITY VARCHAR2 (2000 BYTE),
    VARCHAR2 (2000 BYTE) SOURCE,
    VARCHAR2 (2000 BYTE) APPLICATION,
    COMMENTS VARCHAR2 (2000 BYTE),
    DATE OF TLM,
    ADSTAT CHAR (1 BYTE),
    SID NUMBER (10, 0),
    SECURITYLEVEL VARCHAR2 (100 BYTE),
    ENABLE CONSTRAINT PRIMARY KEY (LOCATIONID, CPI, PRODUCTIONWEEK) OMPPRODUCTION_PK
    )

    He has field PRODUCTIONWEEK that is to be given YYYYMMDD.

    I want to select records that are starting the week underway (Monday as departure day).

    for example, the date is 20120210 so I would choose the lines including the date more or equal to 20120206.

    Can someone guide me how it is possible?

    Published by: MaheshGx on 6 February 2012 16:16

    MaheshGx wrote:
    Select * from OMPPRODUCTION where to_number (to_char (to_date (productionweek, 'yyyymmdd'), 'WW')) > = to_number (to_char (sysdate, "WW"))

    Wow, why so complicated?

    You work with dates, so:

    (a) why the hell you store dates in a column VARCHAR2? (and worse yet, why is 200 bytes of length)? Store dates as the DATE. The optimizer based on CSSTidy will thank you. As well, you know, you won't be wasting space.
    (b) compare with the dates, not dates-converted dates - dates-converted-to-number numbers. Why do extra work when you have not to?

    Since you're after weeks from Monday, I'd go for the format mask "IW", since it is fixed and will always return the Monday of the current week ("WW" could return Sunday or Monday, depending on what are your NLS settings.) I'd rather have my labour code for those who executes it, regardless of their NLS settings).

    So, given the fact that your column is not the DATE data type, it would be more effective for you;

    select *
    from   ompproduction
    where  trunc(to_date(productionweek,'yyyymmdd'), 'iw') >= trunc(sysdate, 'iw');
    

    If you have an index on productionweek that you need help in this query, then I suggest to convert it to a basic index function.

  • Return only the records with a string of text that is less than a certain value?

    Hi people,

    I'm not sure whether this is possible or not, but worth-

    I need to be able somehow output only the lines with the text of a column field less to (because of the arguments) 30 characters (including spaces). I know that I can use CFs Left() function to cut the chain, but I don't want to have words cut off mid-sentence. Therefore, I want to somehow restrict the query to only the records that contain a string of less than 30 characters.

    Is this possible?

    Thanks in advance :-)

    You can use the length of the db function. It may or may not be named LEN()

    SELECT SomeColumn
    FROM YourTable
    WHERE LEN (SomeColumn)<=>

    Or you can retrieve all of the records and use one of the functions of the chain at cflib.org as FullLeft().
    http://www.cflib.org/UDF.cfm?id=329

  • My ipod 5 randomly stopped working. First of all, it wouldn't connect to the wifi and now I can't even turn it on. It's the second ipod 5 I've owned that stop less than a year to two years of owning. Why he keep doing this?

    Why my ipod 5 stopped working randomly?

    Unless you are abusing the iPod (i.e., a fall) it seems that you are just out of luck.

    Have you tried the following:

    - iOS: do not respond or does not light

    -Also try DFU mode recovery mode post-test

    How to put iPod touch / iPhone in DFU "Karthik doodles."

    -If failed and that you cannot completely turn completely the iOS device, leave the battery to drain completely. After loading a hour repeat the foregoing.

    -Try a different cable

    -Try on another computer

    S ' there is still not successful that usually indicates a hardware problem and an appointment at an Apple store Genius Bar is in order.

    Shop Apple Store - Genius Bar

  • best way to find the maximum value that is less than a specific value?

    Hello guys,.

    What is the fastest way to find a record that has value max of a field and there is a limitation to a specific value for ex:

    example 1:
    create table dummy(master_id number, detail_id number, some_value varchar2(80));
     
    insert into dummy values (1,1,'bla bla1');
    insert into dummy values (1,2,'bla bla2');
    insert into dummy values (1,3,'bla bla3');
    insert into dummy values (2,1,'bla bla4');
    insert into dummy values (2,2,'bla bla5');
    insert into dummy values (2,3,'bla bla6');
    insert into dummy values (2,4,'bla bla7');
    commit;
    I want to get:
    1 3 bla bla3
    2 4 bla bla7
    And these applications give a correct result:
    Select * 
    from   dummy d1
    where  detail_id = (select max(detail_id) from dummy d2 where d2.master_id = d1.master_id);
     
    OR next one which i prefered.
     
    Select *
    From   (Select d1.* , row_number() over(partition by master_id order by detail_id desc) r
            from   dummy d1)
    Where  r = 1;
    If these solutions are enough or is there a better way?

    Edited by: elcaro on 13.Ara.2011 04:02

    Edited by: elcaro on 14.Ara.2011 04:31

    Please try this with your new test tables:

    select m.master_id,
           m.master_data,
           max(d.id) keep (dense_rank last order by data_value, d.id) d_id,
           max(d.master_id)  keep (dense_rank last order by data_value, d.id) d_master_id,
           max(data_value) keep (dense_rank last order by data_value, d.id) d_data_value,
           max(date_data)  keep (dense_rank last order by data_value, d.id) d_date_data
    from master_dummy m, detail_dummy d
    where m.master_id=d.master_id
    and d.date_data <= to_timestamp('04012010','ddmmyyyy')
    group by m.master_id, m.master_data
    

    Published by: hm on 14.12.2011 05:18

    (I added d.id column in the order by the dense_rank. clause that could make a difference when there is more than one line with the same data_value).

  • You can remove some microsoft updates that are older than the recent updates that are being installed

    I need to know if I can remove old updates from microsoft after upgrades

    Thanks for any help I receive

    E-mail address is removed from the privacy *.

    NO, you cannot uninstall updates if the operating system has been updated because it would mean that another edition of Windows is now installed.

    MowGreen
    Expert in Windows IT Pro - consumer safety

    * - 343-* FDNY
    NEVER FORGOTTEN

  • My Windows Vista computer does not see the network or printers that are connected to a computer using Windows XP

    before that norton was installed, it worked, but since Norton was installed AND DELETED, Vista will not see XP or its printers.

    I have checked the firewall and they took two computers, but still no luck.

    Hello

    Did you change your computer?

    This problem occurs if the (LLTD) link layer topology discovery Responder component is not installed on the Windows XP computer.

    Network card in Windows Vista makes network diagrams of connections between network devices that can be used to troubleshoot connectivity issues. Network map uses a discovery protocol called Link-Layer Topology LLTD (Discovery) that queries other devices on the network to determine how the network is organized.

    Windows Vista includes the software components that implement the LLTD protocol. For other devices on the network to display on the map, they must activate a discovery protocol that can meet the demands of mapping from the Windows Vista-based computer.

    I suggest you to install the update on windows XP.

    http://www.Microsoft.com/download/en/details.aspx?amp;amp;amp;displaylang=en&ID=5577

    This reference so

    http://TechNet.Microsoft.com/en-us/library/bb727037.aspx

  • Can we get all the contacts that are in the Blackberry phone using the PIM functionality that is, JSR 75?

    Hello guys,.

    I need to develop an application that should support devices such as the Bold 9700 and Pearl, Storm, Blackberry Curve 8900. If I go for j2me / MIDP, what will be the limits that I face in blackberry? Is it recommended to go for j2me or device-specific development of RIM.

    Can we get all contacts into the Blackberry phone using PIM JSR 75 i.e and other native features features if developing an application in j2me for blackberry. I guess that the user interface will be completely different, but we support all the controls that supports the JDE?

    Is someone can you please tell me if I can get access to all contacts present in the Blackberry phone using 'javax.microedition.pim' API - that is not specific to the RIM. Has anyone tried this one virtually on the phone or emulator?

    Y at - it something like a website where I can test my application on Blackberry devices as in the Nokia Forum Sites?

    Thanks in advance.

    Kind regards

    Raki

    JSR75 is supported

    However, there are some extensions specific "Blackberry" for the base PIM classes. These add a few extension Blackberry PIM data. I think that you can only use the JSR 75 classes as long as you don't need BB extensions.

    For the test, the development environment provides the device simulators.

  • Using GET_FILE RIDC, I am unable to download files that are greater than 2 GB in size. Help, please

    I am re-publication, as advised by the first time I asked this question.

    https://community.Oracle.com/thread/3674550

    Please let me know if I am wrong anywhere. Its working perfectly for 1.5 GB sized files.

    dataBinder.putLocal ("IdcService", "GET_FILE");

    dataBinder.putLocal ("dDocName", ucmBean.getdDocName ());

    dataBinder.putLocal ("RevisionSelectionMethod", "LatestReleased");

    ServiceResponse myServiceResponse = null;

    myServiceResponse = client.sendRequest (userContext, dataBinder);

    intReportedFileSize = myServiceResponse

    .getHeader("Content-Length");

    InputStream myInputStream = null;

    InputStreamReader myInputStreamReader = null;

    try {}

    myInputStream = myServiceResponse.getResponseStream ();

    String ucmFileName = ucmBean.getdDocName () + "."

    + ucmBean.getFileExt ();

    File = new File ("C:/UCMFiles /" + ucmFileName);

    OutputStream oos = new FileOutputStream (file);

    If the file does not exist, create it and then

    If (! file.exists ()) {}

    try {}

    file.createNewFile ();

    } catch (IOException e) {}

    Generative TODO catch block

    e.printStackTrace ();

    }

    }

    try {}

    myInputStreamReader = new InputStreamReader)

    myInputStream, 'UTF-8');

    OutputStream out = new FileOutputStream (file);

    Byte buf = new byte [1024];

    int len;

    While ((len = myInputStream.read (buf)) > 0) {}

    out. Write (buf, 0, len);

    intRetrievedFileSize += len;

    }

    out. Flush();

    out. Close();

    myInputStream.close ();

    totalSize += intRetrievedFileSize;

    } catch (IOException e) {}

    e.printStackTrace ();

    }

    The 11g RIDC JAR is backward compatible. Thus, I advise to use the last RIDC JAR from here: http://www.oracle.com/technetwork/middleware/webcenter/content/downloads/index.html

    Jonathan

    http://jonathanhult.com

Maybe you are looking for

  • How can I unlock my iMac?

    I have an iMac hand (my first) and clicked on Front Row, wondering what it was.  So I now have its opening screen locked and can't get out of the program and return to my home screen.  I tried all combos of Esc, Ctrl, Cmd, Option and nothing seems to

  • Change the size of the shortcut icons?

    From the moment I left my computer for the night, until the next morning, the small icons of shortcuts on my desktop turned into large icons.  How to make a comeback?

  • HP Color Laserjet 2600n cleaning

    Dear members of the Forum Please can you advise. I am runnng meanings on windows vista. Re stimuli of print quality problems. The manual recommends the fuser unit and the cleaning of the engine using the HP Toolbox. However the Vista operating system

  • KB2699988 update fails with error code 80070020

    My system running Windows Vista Home Professional with Service Pack 2 has tried to install KB2699988 many times and still no update. The failure of the update gives the error code 80070020. I performed the recommended including troubleshooting steps:

  • How to determine the memory total & free memory Vista Ultimate SP2

    Insert shows possible reason for his inability to exercise a function can be (among other reasons) lack of free memory.I Armi and easily access for free RAM, but no mention of information relative to the memory.You will appreciate the help by more kn