Can anyone help with my function please?

Hi all

I created a function and I was wondering if someone could take a look and help me with a particular problem, that I am experiencing. The function is shown below. It works fine, but I get the following error:

The method call failed because [System.Object []] does not contain a method named "op_Division.

D:\SR\WindowsPowershell\Modules\SRvSphereTools\SRvSphereTools.psm1:875 char: 13

+ $VMprops = [ordered]@{'Name' = $vmview.] Name;

+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ CategoryInfo: InvalidOperation: (op_Division:String)], RuntimeException

+ FullyQualifiedErrorId: MethodNotFound

Now, I know when I get this error whenever I enter a virtual machine name that has a suffix. Which means that I will enter a virtual machine as a 'Server' name and it relates very well again. When I enter a name such as "server_' it relates with the above error again.» I also noticed if I go in $ server he reports again with the name shortened to the server. Is it something to do with my input variables, do not deal with the prefix. I wouldve thought that he would bring back ' the two inputs to the output.

As usual any help would be MUCH appreciated.

Thank you

Munster99

Function Get - xVM {}

< #.

. LOGBOOK

Gets the IMPORTANT details for a virtual computer

. DESCRIPTION

Gets the relevant information for a virtual machine

. PARAMETER vmname

An object 'vSphere VM' or a 'string. '

. ENTRIES

Input object Types\\

[VMware.VimAutomation.ViCore.Impl.V1.Inventory.VirtualMachineImpl] or

[System.String]

. EXAMPLE OF

PS > Get-SRVM - VM1, VM2 VM...

. EXAMPLE OF

PS > Get-Content C:\VMs.txt | Get - xVM | Export-csv c:\VMResults.csv

. EXAMPLE OF

PS > Get - xVM server | Export-csv c:\VMResults.csv

You can send an a vCenter Server virtual computer object through the pipeline.

. NOTES

Version: 1.0 - the first project

# >

[CmdletBinding()]

(PARAM

[Parameter (mandatory = $true,)]

ValueFromPipeline = $true,

ValueFromPipelineByPropertyName = $true,

Position = 0,

HelpMessage = "Please enter the VM name")]

[ValidateNotNullOrEmpty()]

[Alias ('Name')]

[PSObject []] $VMName.

[Parameter()]

[switch] $ShowWindow

)

BEGIN {}

$OutputObj = @ () # output initialization object array

}

{IN PROCESS

{Foreach ($VM to $VMName)

$VM Write-Verbose

$VM Write-Verbose. GetType(). Name

If ($VM. GetType(). Name - eq 'string') {}

$vmview = get-View - Viewtype VirtualMachine-property name, summary, reviews, filter-Config @{'Name' = '$VM'}

If (!) (($vmview))) {}

Write-Warning "$VM is NOT a virtual machine.

Continue

}

} # If

ElseIf ($VM - is [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VirtualMachineImpl]) {}

$VM Write-Verbose. Name

$vmview = get-View - Viewtype VirtualMachine-property name, summary, reviews, filter-Config @{'Name' = '$VM'}

} else if #.

#---Insert Get code here

$VMprops = [ordered]@{'Name' = $vmview.] Name;

"ToolsStatus" = $vmview.guest.ToolsStatus;

'CTKEnabled' = ($vmview. Config.ExtraConfig | where {$_.key - eq "ctkenabled"}) .value;

'vCPUs' = $vmview.summary.config.NumCpu;

"vCPUsPerSkt" = $vmview.config.hardware.NumCoresPerSocket;

'RamGB' = ($vmview.summary.config.MemorySizeMB/1kb);

'IP' = $vmview.summary.guest.ipaddress;

'Portgroup' = $vmview.guest.net.network;

'MAC' = $vmview.guest.net.MacAddress;

'UuID' = $vmview.summary.config.Uuid;

}

$Obj PSObject = new-Object-property $VMProps

$OutputObj += $Obj

} # foreach VM

} foreach process #.

{END}

Write-Output $OutputObj # exit EXIT pipeline objects

}

}

If the Get-View Filter parameter returns more 1 object in these cases?

Remember that the filter uses a RegEx expression.

Try the filter like that

$vmview = get-View - Viewtype VirtualMachine-property name, summary, reviews, filter-Config @{' Name'= "^ $($VM) ' $ '"}

Tags: VMware

Similar Questions

  • How can I get a google font (Capriola) in Muse. I pasted the code in the head of html, but the police will not be displayed. Can anyone help with teamviewer?

    How can I get a google font (Capriola) in Muse. I pasted the code in the head of html, but the police will not be displayed. Can anyone help with teamviewer?

    This is kind of a hack, but it will work.

    1. you will need to download a copy of the Capriola on your computer and install it as a system font. Google Fonts will allow you to install it as a system font in some methods (download a.) (ZIP file, synchronization with SkyFonts or downloadable on the project in Google Code). Edit: the simplest is to add the font to your collection of fonts in Google and then download one. ZIP file of your font collection.

    2. the font squirrel website has a generator of quality web fonts. It may take a font installed on your computer system and generate all the files of web fonts needed him. Place the web font files in the folder of your Muse project where you want to store the web fonts self-hosted. Use the add web fonts in Muse and select the tab fonts self-hosted.

    IMPORTANT: Please read the license terms for any font that you want to use on your website. Fonts Open source as Capriola may seem safe to use at first, but the developer of fonts may have some requirements, such as the display of a link to their web site somewhere in your own site. Other fonts may have monthly limit on number of pages seen.

  • can anyone help with drivers for invetel/coshiba 3887 rev0 vista

    can anyone help with drivers vista for invetel/coshiba 3887 rev0 54g wifi
    I looked everywhere goot virus and God knows what. Lucy was protected.

    Hello

    Method 1:

    I suggest you to see link and check.

    Windows wireless and wired network connection problems

    http://Windows.Microsoft.com/en-us/Windows/help/wired-and-wireless-network-connection-problems-in-Windows?T1=Tab03

    Update drivers: recommended links

    http://Windows.Microsoft.com/en-us/Windows-Vista/update-drivers-recommended-links

    Method 2:

    I suggest to download and install the Microsoft safety scanner and run the scan and check.

    http://www.Microsoft.com/security/scanner/en-us/default.aspx

    WARNING: There could be a loss of data while performing an analysis using the Microsoft safety scanner to eliminate viruses as appropriate

    I also suggest you contact the manufacture of the product and check.

  • Installation update for creative cloud can never exceed 2%, which means that I cannot have access to Premiere Pro. Can anyone help with this?

    Installation update for creative cloud can never exceed 2%, which means that I cannot have access to Premiere Pro. Can anyone help with this? I need urgent access to Premiere Pro, so I can return videos to my clients.

    Check your (win) Task Manager or activity (mac) for a suspended adobe monitor helps the process that you can complete.

  • Illustrator draw android app says that it requires 4.3. I have a viking RCA pro 10.1 which is 5.0, but it says that my device is not compatible. Can anyone help with this?

    Illustrator draw android app says that it requires 4.3. I have a viking RCA pro 10.1 which is 5.0, but it says that my device is not compatible. Can anyone help with this?

    HI JBlessed,

    What is a Tablet? Because the draw is not yet supported on Android tablets.

    Sue.

  • Hi can anyone help with, where can I download 11.1.1.6.0 version of OSB

    Hi can anyone help with, where can I download 11.1.1.6.0 version of OSB

    Hello

    The Oracle Software Delivery Cloud and OTN currently have SP6 / 11.1.1.7 for download.

    Older versions are archived internally, but they are still available.

    File an SR to My Oracle Support , and we will have our support team provide you with a specific url to the platform and the version you need.

    See you soon

    Iain

  • I get an error indicating cc cookies dir: cannot do file / cookies: permission denied (error 13) when I tried to download the installer of creative cloud on my Mac. Can anyone help with similar pop-up window?

    I get an error indicating cc cookies dir: cannot do file / cookies: permission denied (error 13) when I tried to download the installer of creative cloud on my Mac. Can anyone help with similar pop-up window?  I try to get a trial version of CS5.

    You don't need to involve creative cloud to install try the trial version of CS5...

    You can download the demo version of the software through the page linked below and then use your current serial number to activate it.

    Don't forget to follow the steps described in the Note: very important Instructions in the section on the pages of this site download and have cookies turned on in your browser, otherwise the download will not work correctly.

    CS5: http://prodesigntools.com/all-adobe-cs5-direct-download-links.html

  • I have Outlook Express 6. When I try to send/receive my mail I get this error: Protocol: POP3, Port: 110, secure (SSL): no, error number: 0x800C0133 can anyone help with this please

    I went and read a few articles on this I tried to delete the Folders.dbx, renamed server, flip pass and username. I just can't go there. Can anyone help on this.

    Thank you

    It isn't Folders.dbx which is screwed, it's Inbox.
     
    **************************************************
     
    Error number: 0x800C0133 = a corrupt Inbox.
     
    Move any message you want to save to a local folder that you create. Then, remove the problem of Inbox as follows.
     
    Tools | Options | Maintenance | Store folder will reveal the location of your Outlook Express files. Note the location and navigate on it in Explorer Windows or, copy and paste in start | Run.
     
    In Windows XP, Win2K & Win2K3 the OE user files (DBX and WAB) are by default marked as hidden. To view these files in Windows Explorer, you must enable Show hidden files and folders under start | Control Panel | Folder options | View.
     
    With OE closed, find the box of Inbox.dbx and delete it. Another will be created automatically when you open OE.
     
    General precautions for Outlook Express:
     
    Do not archive mail in the receipt or sent items box. Create your own user-defined folders and move messages you want to put in them. Empty the deleted items folder daily. Although the dbx files have a theoretical capacity of 2 GB, I recommend all a 300 MB max for less risk of corruption.
     
    After you're done, followed by compacting your folders manually while working * off * and do it often.
     
    Click Outlook Express at the top of the the folder tree so no folders are open. Then: File | Work offline (or double-click on work online in the status bar). File | Folder | Compact all folders. Don't touch anything until the compacting is completed.
     
    Disable analysis in your e-mail anti-virus program. It is a redundant layer of protection that devours the processors and causes a multitude of problems such as time-outs and account setting changes. Your up-to-date A / V program will continue to protect you sufficiently. For more information, see:
    http://www.oehelp.com/OETips.aspx#3
  • can anyone help with drivers for Minolta Scan3 double for the Vista operating system

    If anyone can help with drivers for Minolta Dualscan 3 working with Vista?  3 Dualscan will work with Windows 7 or Linux?

    Hi Mike,.

    You can download and install the drivers for Minolta Dualscan 3 from this link.

    http://onyxftp.mykonicaminolta.com/download/Search.aspx?HT=

    Hope the helps of information.

    Please post back and we do know.

  • problems with messenger facebook can anyone help with this

    My facebook messenger is installed successfully but yet when I open it, just of maintains load and does not open even the newspaper on the page please help me with this

    Contact Facebook support for help with their program.

  • Can anyone help with SQL for update?

    Hello

    can someone help me with this code


    2 tables.
    Table 1 = User_master
    Table 2 = update_users

    I need to update user_master as follows...
    Update user_master
    set status = 'I '.
    When user_id IN)


    problem is that I have over 10 k user_id to update.
    So created a new table called update_users and imported from all user_id in this table.
    How can I read all user_id table, then update the status for all user_master column
    ID of users found in update_users?


    I already tried this...
    Update user_master p.user_id p
    set status = 'I '.
    When user_id = (select user_id from update_users where p.user_id = user_id)

    It did not work-
    ERROR on line 2:
    ORA-01427: einreihig subquery returns multiple rows


    Thank you

    have you tried

     update user_master
     set status = 'I'
     where user_id IN (select user_id from update_users);
    

    Published by: release 6' - 8 "June 1, 2010 16:23

  • Please can anyone help with this?

    Basically, this is what im trying to reach

    I want an image on paper 15 x 10 inch 9.5x13.5 inches. So I need to resize my image, the image in original size without any cropping is 14.613x10.96 inches is slightly smaller after mounting and a bit of cropping. I was told I need 300 dpi for the laboratory to print it and was unsure about using the resample option because it can affect the quality. What would be the best way to do this is? I use ps cs6

    The pixels in your image, when the 300 per linear inch, provide the exact size you want.

    There is no need to modify the content of the image.

    When cropping a picture, you're not resampling.

    If the cropped image had a greater number of pixels in its length or width than the numbers you specified that you wanted the image either 9.5 x 12.5, to 300 ppi you must resample, throw pixels, in order to reach the size desired and res.

    Resampling indicates that pixels are subtracted or added to the file in order to adapt to a given change in the size and resolution.

    Do not add or remove pixels. You presented it in the size desired as 300 ppi. Quality is not diminished, not touched...

    If the lab wants an image that meets the specifications in my illustration above, you're good to go.

  • Can anyone help with reader of News RSS in AS3?

    With a tutorial from weblog AlaaShaker I designed 2 different RSS news readers:

    1.       Box to divide into 2, upper part shows a series of titles. When you click a title of arrears of relevant description in the lower part

    2.       A box, where it shows a series of titles. When you click on a title, it connects an individual URL.

    Both work, but ideally, I'd like to combine these two solutions as follows:

    Box Split into 2 parts as version 1, the upper part shows a series of titles. When you click on a relevant description title appears in the lower part. By clicking on the description in the lower part, it connects to an individual url.

    Can someone please please help? My knowledge of flash is very very basic and I'm not getting anywhere. I already spent days on this subject.

    Thank you much in advance.

    ActionScript 3 for feed READER (title, description)

    Import fl.managers.StyleManager;

    var logFormat:TextFormat = new TextFormat();

    logFormat.font = "Verdana";

    logFormat.size = 11;

    logFormat.italic = true;

    logFormat.bold = true;

    logFormat.color = "0 x 313131."

    StyleManager.setStyle ("textFormat", logFormat);

    var rssLoader:URLLoader = new URLLoader();

    var rssURL:URLRequest = new URLRequest ("http://www.conyercc.org.uk/ccc_rss.xml");

    rssLoader.addEventListener (Event.COMPLETE, rssLoaded);

    rssLoader.load (rssURL);

    var rssXML:XML = new XML();

    rssXML.ignoreWhitespace = true;

    function rssLoaded(evt:Event):void {}

    rssXML = XML (rssLoader.data);

    / / trace (rssXML);

    for {(var: chaîne d'élément dans rssXML.channel.item)}

    liLog.addItem ({label: rssXML.channel.item [item] .title});

            }

    }

    function selectLog(evt:Event):void {}

    var list: XMLList =

    rssXML.channel.item [evt.target.selectedIndex]. children();

    var point: XML;

    for (var i = 0; i < list.length (); i ++)

    if (list [i] .name () == 'description')

                    {i ++; break;}

    item = list [i] .children () [0];

    taLog.htmlText = rssXML.channel.item [evt.target.selectedIndex] .description;

    }

    liLog.addEventListener (Event.CHANGE, selectLog);

    ActionScript 3 for RSS reader (title - link)

    Import fl.managers.StyleManager;

    Import fl.events.ListEvent;

    var logFormat:TextFormat = new TextFormat();

    logFormat.font = "Verdana";

    logFormat.size = 11;

    logFormat.italic = true;

    logFormat.bold = true;

    logFormat.color = "0 x 313131."

    StyleManager.setStyle ("textFormat", logFormat);

    var rssLoader:URLLoader = new URLLoader ();

    var rssURL:URLRequest = new URLRequest ("http://www.conyercc.org.uk/ccc_rss.xml");

    rssLoader.addEventListener (Event.COMPLETE, rssLoaded);

    rssLoader.load (rssURL);

    var rssXML:XML = new XML();

    rssXML.ignoreWhitespace = true;

    function rssLoaded(evt:Event):void {}

    rssXML = XML (rssLoader.data);

    for {(var: chaîne d'élément dans rssXML.channel.item)}

    liLog.addItem ({.link label:rssXML.channel.item[item].title,link:rssXML.channel.item[item]});})

        }

    }

    liLog.addEventListener (ListEvent.ITEM_CLICK, clickedLogF);

    function clickedLogF(e:ListEvent) {}

    navigateToURL (new URLRequest ((liLog.getItemAt (e.index) .link)));

    }

    The easiest way is to wrap your description with tag to make it a link:

    taLog.htmlText = "" + rssXML.channel.item[evt.target.selectedIndex].description + "";
    

    (I've added attribute 'target' for you)

  • Can anyone help with my custom show?

    Hey there!

    I really hope someone can help me because it's the last step to fill my site in Adobe Muse!

    I have an idea for a show that looks like the image (attached). An image is fully displayed, while the right side shows that partially the next image in the slideshow. When the user clicks the next button, the image partially showing slides everywhere and in the completely displayed position allowing another new image display partially.

    After scouring all the widgets of Muse, as I can find, I was not successful in finding a widget that will happen as described above, and I also failed to find a way to do this with the built-in widgets of Muse.

    Is there anyone who might be able to help me achieve this by using an existing widget or something built in Muse post-marketing? Or is Adobe or anyone else able to do something that I could use and run like that?

    Big ask, but I really hope someone can help!

    Thank you very much

    Dominic

    Screen Shot 2015-09-12 at 20.27.31.png

    You can try something like this: delicate slideshow

    It is not a perfect solution (you must prepare your images) and according to the website loading speed, it can be ruined if the images will load to slow down, but I don't know any other way to do something like that.

    My English is poor to do the explanation of text, but I think you can understand this by looking at the top link demo. You need to cut the image in half and compositing as the colors in my example. Then use 2 slideshows and set it horizontally and give them the same timings. Then you have to feed slideshows with pictures in the correct order (Te [1,2,3] [3,1,2] depends on how many images you use). That's all. Problem is when the images are heavy and does not load simultaneously.

    Greetings

  • Can anyone help with my inDesign CS6 download?

    We bought inDesign CS6 online, but it did come with a disc. Instead, I was invited to pass the link on http://helpx.adobe.com/x-productkb/policy-pricing/cs6-product-downloads.html

    After downloading CS6 Design Standard (records 1 and 2), the largest of the two files was recorded in my download as a file 7Z folder. The smaller file has been the "extractor". I click on that it is for me the folder location box, and then I click Next. At this point, the following message appears: "is a problem when extracting files.» Check the amount of space available on your computer and the rights to write to the destination folder"after clicking OK, this message appears:" a problem occurred during extraction of archive. ". Please try to download Adobe CS6 design standard yet. "After clicking on OK, it is the last message displayed:"EListError Exception in the DesginStandard_CS6_LS16exe module to 0001B6E3. "List index out of bounds (0)" accompanied by the dreaded red x.

    It wasn't a purchase at low prices. And my computer is only five months, while the memory should not be a problem. Does anyone have any suggestions? For starters, any idea on how to open a 7Z file? Any help would be greatly appreciated. Thank you!

    Dan

    You are welcome.

    Keep me posted on your progress, even (or especially) if it's just to say, 'all is well '... We should be able to solve this problem today.

Maybe you are looking for