Simple AS2 script output produces Undefined

I am in Flash CS3 Pro with the settings of the specific flash for ActionScript 2.0 and Flash Player 9 in publication settings. If you run this script AS 2.0 in a framework, generates and undefined message in the output window. Any thoughts on why? I am an online course instructor and cannot understand what would generate the error since I'm following. Any help appreciated.

Thank you!!

Chris

You must be followed are multiplying, since it is the name of the function, IE:

trace (multiply (5, 6));

Tags: Adobe Animate

Similar Questions

  • Output is not as expected (getting wrapped) for a simple sql script

    Hello

    I try to run a simple sql script with a few queries including a semi colon output (;) when text file separated that later - I can open in excel.

    My SQL file contains in part the code - below

    SELECT
    "PORTFOLIO" | « ; » ||
    "CONTRACT # | « ; » ||
    "CONS_INV #" | « ; » ||
    "CUSTOMER #" | « ; » ||
    "CLIENT_NAME | « ; » ||
    'MESSAGE ' | « ; » ||
    "REQUEST_ID" | « ; » ||
    "BILL_TO_COUNTRY" | « ; » ||
    "BILL_TO_ADDRESS1" | « ; » ||
    "BILL_TO_ADDRESS2" | « ; » ||
    "BILL_TO_ADDRESS3" | « ; » ||
    "BILL_TO_ADDRESS4" | « ; » ||
    "BILL_TO_CITY" | « ; » ||
    "BILL_TO_POSTAL_CODE" | « ; » ||
    "BILL_TO_STATE" | « ; » ||
    "BILL_TO_PROVINCE" | « ; » ||
    "BILL_TO_COUNTY" | « ; » ||
    "SHIP_TO_COUNTRY | « ; » ||
    "SHIP_TO_ADDRESS1" | « ; » ||
    "SHIP_TO_ADDRESS2" | « ; » ||
    "SHIP_TO_ADDRESS3" | « ; » ||
    "SHIP_TO_ADDRESS4" | « ; » ||
    "SHIP_TO_CITY" | « ; » ||
    "SHIP_TO_POSTAL_CODE" | « ; » ||
    "SHIP_TO_STATE | « ; » ||
    "SHIP_TO_PROVINCE" | « ; » ||
    "SHIP_TO_COUNTY" | « ; » ||
    "INVOICE_DATE | « ; » ||
    "INVOICE_CREATION_DATE" | « ; » ||
    "PARTIALLY_DROPPED" | « ; » ||
    "AMOUNT".
    OF the double
    /
    SELECT "DOUBLE
    /
    SELECT "error Code" | « ; » ||' Error message "OF the DOUBLE
    /

    SELECT lookup_code. « ; » || Description
    OF fnd_lookup_values
    WHERE lookup_type = 'CUST_ERROR. '
    /

    The issue I'm facing is that the output of the competitive program file comes out bit so enter each line only 132 characters in a line and therefore gets pushed in the next row in excel.

    Output-

    PORTFOLIO; CONTRACT #; CONS_INV #; CUSTOMER #; CLIENT_NAME; MESSAGE; REQUEST_ID; BILL_TO_COUNTRY; BILL_TO_ADDRESS1; BILL_TO_ADDRESS2; BILL_TO_A
    DDRESS3; BILL_TO_ADDRESS4; BILL_TO_CITY; BILL_TO_POSTAL_CODE; BILL_TO_STATE; BILL_TO_PROVINCE; BILL_TO_COUNTY; SHIP_TO_COUNTRY; SHIP_TO_ADDR
    ESS1; SHIP_TO_ADDRESS2; SHIP_TO_ADDRESS3; SHIP_TO_ADDRESS4; SHIP_TO_CITY; SHIP_TO_POSTAL_CODE; SHIP_TO_STATE; SHIP_TO_PROVINCE; SHIP_TO_COUN
    TY; INVOICE_DATE; INVOICE_CREATION_DATE; PARTIALLY_DROPPED; AMOUNT


    Please advice on all of the commands that I can use in the script sql in order to expand the output page or any other workaround solutions!
    Please answer as soon as possible if you can help me!

    Thank you!

    SQL * MORE?

    SQL> set lin 1000
    SQL> spool your_file_out.csv
    SQL> your_query
    SQL> spool off
    

    Kind regards
    Malakshinov Sayan

  • SELECT statement in the script output window

    Hello

    SQL Dev 4.0.3

    is it possible to include select statements from the command run the Script in the Script Output window?

    Is the result in the window:

    Select 1... ;

    results

    Select 2... ;

    results

    Joop

    try to put "set echo on" (without the quotes) as the first line and make sure that you use F5 to run the script... like sqlplus.

  • Get and Set of dynamic Type via the Script output

    I am running vRO 6.0.1. I built a dynamic type to Veeam. I can see the items in the inventory and can select them as attributes in workflows. I'm looking to get the dynamic Type via a script object and set it as a variable in the script output, but its does not work. I created the dynamic type using the type dynamic plug-in generator v2.

    I have 'Veeam' namespace with types:

    VeeamHost

    jobFolder

    job

    I put an output with the 'DynamicTypes:Veeam.job' type attribute and the name jobOut

    My script is just:

    jobOut = Server.findForType ('DynamicTypes:Veeam.job' '29714267-f517-4f76-a621-902b3e789772/urn:veeam:Job:26eddcda-ea52-469b-b4c9-0b80fec098ae');

    System.log ("Job found:" + jobOut "'); 

    After the execution of the jobOut variable is empty. In the newspapers, I see:

    Found job: DynamicWrapper (Instance): [DynamicTypesDynamicObject]-[class com.vmware.o11n.plugin.dynamictypes.model.DynamicObject] - VALUE: dynobj: [__ns:Veeam __id:29714267-f517-4f76-a621-902b3e789772/urn:veeam:Job:26eddcda-ea52-469b-b4c9-0b80fec098ae __tp:DynamicTypes:Veeam.job]

    Does anyone have an idea of how complete the release of DynamicTypes:Veeam.job with the actual work of veeam I got via the script?

    Could check you what happens if you replace the line

    jobOut = Server.findForType("DynamicTypes:Veeam.job","29714267-f517-4f76-a621-902b3e789772/urn:veeam:Job:26eddcda-ea52-469b-b4c9-0b80fec098ae");

    with

    jobOut is DynamicTypesManager.getObject ("Veeam", "task", "29714267-f517-4f76-a621-902b3e789772/urn:veeam:Job:26eddcda-ea52-469b-b4c9-0b80fec098ae");.

  • CreateChild simple script returns an undefined error but runs in the console?

    Hello

    Well, I'm really a newbie... I have read many threads made a lot of research and no matter what I cannot do the following to run correctly in the js file. Even if the code is running in the console...

    / * Bookmark * /.

    var myRoot = this.bookmarkRoot;

    function createBookMark()

    {

    myRoot.createChild ("test", 0);

    }

    app.addToolButton({)

    cName: 'Add bookmark Test', the name of //Button

    cExec: "createBookMark()", call //Function

    cLabel: "Bookmark test", //The text on the button

    cTooltext: "Create bookmark test" //Help text

    });

    Error:

    myRoot is undefined

    25:app:exec

    TypeError: myRoot is not defined

    25:app:exec

    In the console:

    var myRoot = this.bookmarkRoot;

    myRoot.createChild ("test", 0);

    code runs without error.

    What I am doing wrong?

    You must pass myRoot as a parameter to the function. If the function

    header must be:

    function createBookMark (myRoot) {}

    And the call to the function should pass this variable, as follows:

    cExec: "createBookMark (this.bookmarkRoot).

    You need to remove the first line of code (the myRoot statement

    outside of the function). There is no point in the code.

  • ExternalInterface call the Javascript to AS2 array throwing error undefined

    I need to pass various (follow-up) IDs to a .swf.  the IDS are in a table like this =

    < script type = "text/javascript" >

    function getImpID() {}

    var medID = {impID: pvID '12345': ' 677890', exID: '654332'};

    return medID;

    };

    function thisMovie (banner) {}

    If (navigator.appName.indexOf ("Microsoft")! = - 1) {}

    Returns the window [banner]

    }

    else {}

    return the document [banner]

    }

    }

    Window.OnLoad = getImpID;

    < /script >

    For now, the AS2 I is:

    flash.external import. *;

    System.security.allowDomain (sourceDomain)

    var allID:String = ExternalInterface.call.apply ("getImpID");

    function getIDs() {}

    var impID:Number;

    var pvID:Number;

    var exID:Number;

    var id_arr:Array = allID.split(",");

    _root.id_test. Text = impID;

    }

    getIDs();

    Basically, what I need is to divide the three identifiers from the javascript so that I can add with different URL clickTags in the will.  I primarily the "undefined" error, so I'm going out on a limb here I have the AS2 does nothing now value.  More big scratcher head for me is, if I have the ID in an array in javascript (medID) how do I get them not only correctly in Flash, but separate them in their separate identity papers.

    Any suggestions would be greatly appreciated.

    Thank you!

    I forgot to answer, your tips have helped solve the puzzle =

    ActionScript:

    function idTag() {}

    getID = Object (ExternalInterface.call("saveglobalscore",score) ("getImpID"));

    getID.toString ();

    _root.id_test. Text = getID;

    }

    idTag();

    JavaScript

    has worked like a charm!

  • Photoshop script output

    Is there a console or a log output of script event?  I tried to make a function that performs an alert correctly, but does not create a new document.  I can't find is it possible to see if this syntax is incorrect or the command is just outdated.

    In the code below, for example, I see the alert message, but no new document.  I don't see anyway to see what the problem with him and I pulled this line directly from the photoshop scripting guide.

    createDocument var = function() {}

    Alert ("create new doc!");

    App.Documents.Add (2.4);

    };

    IMHO, I don't think so. (I don't have none of that.)

    Maybe I understand you only hurts.

    The only thing you could do - own messages they close again by itself.

    Something like this:

    // CreateNewDocAndShowMessage.jsx
    // http://forums.adobe.com/thread/1237214?tstart=0
    // regards pixxxelschubser
    
    var Call;
    createDocument ();
    
    function createDocument () {
        Call = "creating new doc!";
        CallFunction ();
        app.documents.add (40,40);
        }
    function CallFunction () {
        win = new Window ("palette");
        win.someMessage= win.add ("statictext", undefined, Call);
        win.show();
        $.sleep(1500);
        win.close();
    }
    
  • Please help with some simple AS2

    Hello

    I have a puzzle that I adapted in AS2. It is perfect for my needs, with one exception. It has a 'Start' button that erases the image of the puzzle, so you can start to assemble. I don't need the 'Start' button and am currently placing the script from the 'Start' button in the timeline, so that the picture of the completed puzzle is automatically cleared, ready to start assembling the four parts. The code original source from headache and Tunis is located here:

    http://www.ActionScript.org/resources/articles/13/1/jigsaw-puzzle/Page1.html

    This is the script that is currently on the button:

    We (Release)

    {

    for (i = 1; i < = n; i ++)

    {

    ["p" + i] this.joined_mc ._visible = false;

    }

    }

    and the button is inside a clip on the main stage.

    Please can someone help me on this point - would be really grateful!

    Thank you

    Ed.

    If it's a simple button (not a movieclip button) and attach the button containing the chronology:

    for (i = 1; i<>

    {

    ["P" + i] this.joined_mc ._visible = false;

    }

  • Outputs produced by the analog input job Retrig delay counter

    Hi all!

    First of all, I want to thank everyone on this forum who take the time to answer the questions, this forum has been invaluable to me.  I have a question about delays in adjustment to the pulse output of a counter, like what is described here.  My question is related to another, asked hereon the trigger of an analog signal and producing a pulse for each triggered event.  I have this job and can be seen in the attached vi.  Basically, now I'm able to produce a TTL pulse whenever my analog signal passes a predetermined threshold.  I have also documented the vi to my best understanding, if I have something wrong in the documentation, please let me know.

    In any case, now that I have a pulse at each outbreak, I would like to be able to adjust the delay of events so that the pulse is not produced until the period n/20 (n = 0, 1, 2,... (19) what I expect to see is a similar pulse train in 'fig. 2' in the article, where the white pulse is the counter pulse, and the pulse red would be the same as my analog signal.  So, for example, if I had a 281Hz signal, I want to produce a single pulse with a width defined by the user whenever my signal crosses a threshold (it's zero delay: 0/20); This part may be made using the vi attached to this subject.  Now I want to delay this impulse as to each trigger event, a pulse is not produced until 1/20 of the period, or 0,000178 seconds after the trigger.

    Looking at my vi, I think that if I change the output channel of the meter to 'CO Pulse Time' and then set the respective initial delay, time and little time, I can get delayed impulses mentioned in the article.  Correct me if I'm wrong, but I think that basically 'big time' controls the pulse width. 'initial period' is what controls how long to wait after the first trigger event is reached, before generating a pulse, but this applies only to the first impulse and not the rest; and finally 'small time' is the time to wait before the next pulse is created.

    Earlier today, when I use the CO Pulse Time option, it seemed to work properly for me to a certain degree.  At low frequencies the impulses seem to trigger to each event when the pulse width is set at 2.5% of the period.  When I tested at 281 Hz with a pulse width, 'big time' of 0,000089 sec and without anything wired for the 'initial delay' or 'small time', the impulses seem to ignore systematically each triggers 2... that tells me that something is wrong in my settings, rather than problems with the sample clock.  So I decided to connect '0' to 'small time', but then I got an error message indicating that some time may be less than a value (I forgot what the error message).  So I concluded that I must not understand what these terms mean.

    Sorry for the long explanation, but I really need help with this.  So let's say that the first set of data, I want to acquire is at zero delay, such as pulses are generated at each triggering event like how I have my VI now; so, for the next set of data I want pulses to generate 0,000178 seconds after the trigger threshold; so, for the data set third, I want to pulses to generate 0,000356 seconds after the trigger threshold; and so on... How should I do for this?  Thank you very much!

    Hello!

    Please post on the Forums OR! I think the main issue here is that you are sampling not fast enough to catch all of your high. So you set your high dry 0,000089. You will need to substantially increase the frequency of sampling in order to catch all these. Something around 25 k should do the trick.

    To the extent where using the time counter Pulse, you're totally on track. I think that the use that the delay will do the job.

    I hope this helps! Let me know!

  • AS2 script does not work in Flash Professional CC (was: I really need quick help!)

    Hey guys, I wrote the following on our school-PC Code but now home it fail totally and I have no idea why. My only idea is that I have written in Action Script 2 in school and now in Flash Professional CC can only Action Script 3. If there is someone who can help me that it will work again, I'd be VERY VERY happy!

    OK, here's the Code.

    var currentround = 0;

    var value = 0;

    var points = 0;

    var Leben = 3;

    Var seconds = 0;

    Questions =]

    ["Also yesterday kommt eine question hin!", "Yesterday die erste Antwortmoglichkeit.", "Yesterday the second Antwortmoglichkeit.", "Yesterday die dritte Antwortmoglichkeit.", 'Yesterday die vierte Antwortmoglichkeit.', '3'],

    ["What is 6 + 6', '5', '3', '12', '24', '3'"].

    ["Welche Haarfarbe hat Wladimir Wladimirowitsch Putin?", "Blond", "Braun", 'Fanny', 'Grau', '4'], //Keinen plan was as Haarfarbe hat, ich meine das Grau ist also eine der 4.

    [« 2 », « 4 », « 5 », « 6 », « 5 », « 4 »],

    ['asdadsda', '4', '5', '6', '7', '2']

    ];

    onEnterFrame = function () {}

    Question = issues [currentround] [0];

    A1 = issues [currentround] [1];

    A2 = issues [currentround] [2];

    A3 = issues [currentround] [3];

    A4 = issues [currentround] [4];

    pfeld = points;

    antwortA_btn.onRelease = function() {}

    Value = 1;

    {if(questions[CurrentRound][5]==Wert)}

    richtig();

    }

    else {}

    falsch();

    }

    }

    antwortB_btn.onRelease = function() {}

    Value = 2;

    {if(questions[CurrentRound][5]==Wert)}

    richtig();

    }

    else {}

    falsch();

    }

    }

    antwortC_btn.onRelease = function() {}

    Value = 3;

    {if(questions[CurrentRound][5]==Wert)}

    richtig();

    }

    else {}

    falsch();

    }

    }

    antwortD_btn.onRelease = function() {}

    Value = 4;

    {if(questions[CurrentRound][5]==Wert)}

    richtig();

    }

    else {}

    falsch();

    }

    }

    function richtig() {}

    CurrentRound = currentround + 1;

    Punkte = Punkte + 10;

    Seconds = 0;

    }

    function falsch() {}

    CurrentRound = currentround + 1;

    Points = points-10;

    Seconds = 0;

    }

    };

    Thanks for any help!

    According to me, that there are some things wrong with the code even in AS2. Translation of AS3 is somewhat different and is doomed to failure. But you can read this and begin to get an idea of what the differences are. As all of this is quite short, maybe you should start from scratch in AS3.

    var currentround = 0;

    var value = 0;

    var points = 0;

    var Leben = 3;

    Var seconds = 0;

    Questions =]

    ["Also yesterday kommt eine question hin!", "Yesterday die erste Antwortmoglichkeit.", "Yesterday the second Antwortmoglichkeit.", "Yesterday die dritte Antwortmoglichkeit.", 'Yesterday die vierte Antwortmoglichkeit.', '3'],

    ["What is 6 + 6', '5', '3', '12', '24', '3'"].

    ["Welche Haarfarbe hat Wladimir Wladimirowitsch Putin?", "Blond", "Braun", 'Fanny', 'Grau', '4'], //Keinen plan was as Haarfarbe hat, ich meine das Grau ist also eine der 4.

    ["2", "4", "5", "6", "5", "4"],

    ['asdadsda', '4', '5', '6', '7', '2']

    ];

    addEventListener (Event.ENTER_FRAME, onEnterFrame);

    antwortA_btn.addEventListener (MouseEvent.CLICK, antwortArelease);

    antwortB_btn.addEventListener (MouseEvent.CLICK, antwortBrelease);

    antwortC_btn.addEventListener (MouseEvent.CLICK, antwortCrelease);

    antwortD_btn.addEventListener (MouseEvent.CLICK, antwortDrelease);

    function onEnterFrame(e:Event) {}

    Question = issues [currentround] [0];

    A1 = issues [currentround] [1];

    A2 = issues [currentround] [2];

    A3 = issues [currentround] [3];

    A4 = issues [currentround] [4];

    pfeld = points;

    }

    function antwortArelease(e:MouseEvent) {}

    Value = 1;

    If ([currentround] questions [5] == value) {}

    richtig();

    } else {}

    falsch();

    }

    }

    function antwortBrelease(e:MouseEvent) {}

    Value = 2;

    If ([currentround] questions [5] == value) {}

    richtig();

    } else {}

    falsch();

    }

    }

    function antwortCrelease(e:MouseEvent) {}

    Value = 3;

    If ([currentround] questions [5] == value) {}

    richtig();

    } else {}

    falsch();

    }

    }

    function antwortDrelease(e:MouseEvent) {}

    Value = 4;

    If ([currentround] questions [5] == value) {}

    richtig();

    } else {}

    falsch();

    }

    }

    function richtig() {}

    CurrentRound = currentround + 1;

    Punkte = Punkte + 10;

    Seconds = 0;

    }

    function falsch() {}

    CurrentRound = currentround + 1;

    Points = points - 10;

    Seconds = 0;

    }

  • Oracle SQLDeveloper 4.0, script output, how enabled

    Hello,

    I downloaded Oracle SQLDeveloper 4.0 to use and realized that when issuing of orders DDL 'or DML' as:


    CREATE TABLE (( itg.test () vcol VARCHAR2 ( )40()() TABLESPACE tbs_itg_data;

    INSERT IN test VALUES ('test1');
    INSERT IN test VALUES ('test2');
    INSERT IN test VALUES ('test3');

    is no longer poster the output script, indicating that the table was created and 3 were inserted tuples.

    Please, How can I activate this feature in Oracle SQLDeveloper 4.0, like this function exist in version sqldeveloper 3.2.20.09.87.

    Recognizing.

    Silvio Buttenbender

    I looked more and found the problem.

    I changed my language setting to the Brazilian and you can see the problem.  I will raise a bug and we can fix this.

    There are two solutions of temporary workarounds that you can choose from

    (1) perform all of the product in English or Spanish

    in the sqldeveloper.conf file, add a line

    AddVMOption - Duser.language = on (or for Spanish)

    OR

    (2) remove the translation class causes the error from the pot in which case only the scripts of worksheet will be in English and the rest of the product will be in your language

    It will be a few bits of decompression etc so let me know if you want instructions on that.

  • The Get-VMResourceConfiguration script output

    Hey guys im trying to a csv file with the output of each part of vms and and the number of shares they have. I'm a big Powershell basics, I am learning well so I thought to ask gurus here. I'll place a copy of the script here.

    If I run the command Get-VMResourceConfiguration - VM xxx | Format-List-property CpuSharesLevel for example, I get the result OK but when I try the same thing in my script it doesn't work.

    $start = get-Date

    # Make an array with the result I want.
    # Name, then the property I want in the output.
    # A lot of sandfordit.com of the wiki code it thx much borrowed.

    $table = New-Object system. Data.DataTable 'results '.

    $col1 = New-Object system. Data.DataColumn ([string]) name
    $col2 = New-Object system. Data.DataColumn NumCpuShares, ([string])
    $col3 = New-Object system. Data.DataColumn CpuSharesLevel, ([string])

    $table.columns.add ($col1)
    $table.columns.add ($col2)
    $table.columns.add ($col3)

    $duration = (new-TimeSpan (Get-Date) $start). TotalSeconds
    "Lagde tahon etter $duration sekunder.

    # Me make a list of vmms in a folder of the virtual Center

    $vms = get-file Boris_test | Get - VM | Sort - the property name

    $duration = (new-TimeSpan (Get-Date) $start). TotalSeconds
    "Inte antall vmer etter $duration sekunder.

    foreach ($vm to $vms)
    {
    $row = $table. NewRow()

    $row. Name = (Get-VM-name $vm). Name
    $row. NumCpuShares = (Get-VMResourceConfiguration - VM $vm |) Property Format-List-NumCpuShares). NumCpuShares
    $row. CpuSharesLevel = (Get-VMResourceConfiguration - VM $vm |) Property Format-List-CpuSharesLevel). CpuSharesLevel

    $table. Rows.Add ($row)
    "Til rad for $vm.
    }

    $duration = (new-TimeSpan (Get-Date) $start). TotalSeconds
    "Tahon fyllt ut etter $duration dry.

    $table | Format-Table
    $table | Export-Csv-path test.csv

    THX Boris

    Hi Boris,.

    If you change the two lines:

    $row. NumCpuShares = (Get-VMResourceConfiguration - VM $vm |) Property Format-List-NumCpuShares). NumCpuShares
    $row. CpuSharesLevel = (Get-VMResourceConfiguration - VM $vm |) Property Format-List-CpuSharesLevel). CpuSharesLevel

    in:

    $VMResourceConfiguration = get-VMResourceConfiguration - VM $vm

    $row. NumCpuShares = $VMResourceConfiguration.NumCpuShares
    $row. CpuSharesLevel = $VMResourceConfiguration.CpuSharesLevel

    your script works.

    In the new code, I inserted an additional line to call Get-VMResourceConfiguration only one time. This will make the script a bit faster.

    Best regards, Robert

  • Strange script output format

    I have a problem I can not quite understand. I execute a command that returns a string like this:
    Server name: VM_TEST1
    All I get is the value after the VM_, which corresponds to the actual name of the server. VM_ designated as a virtual machine. So I try to get just TEST1. I can do the following


    $name_temp = $name | Select-String - pattern "servername" | Out-string. foreach {$_.split(":") [-1]}

    I'm left with: VM_VMTEST1 so I remove spaces before and the VM_

    $name = $name_temp. Remove (0.4)

    Now I find myself with just the name, but for some reason when I run the script is output like this:

    TEST1

    TEST2

    TEST3


    I do not understand why he puts three lines between each server name.  This happens if I run the CLI, powergui or even export to a file.

    The problem you have is the combination of the Select-String and out-string cmdlets. The Select-String cmdlet does not return a string but returns a Microsoft.PowerShell.Commands.MatchInfo object. For example:

    IgnoreCase: true

    LineNumber: 1

    Line: Server name: VM_TEST1

    File name: InputStream

    Path: InputStream

    Model: Name of the server

    Context:

    Matches: {server name}

    If you use the out-string cmdlet to a string of this object, it adds blank lines.

    As you can see the original line is the line of this object property. We can use this line property in our code. Like this:

    $name_temp = $name | Select-String - Pattern "servername" | ForEach-Object {$_.} {Line.Split ('_') [1]}

    Best regards, Robert

  • small script output formatting

    Hello Experts,

    I'm trying to start with powerCLI, am very new to scripting.

    want to go is to recover 'VMName OSFullName, IPAddress, host, data store' for a specific virtual machine or the VM...

    To do this, I wrote

    Param ($VMName)

    $vm = get - VM $VMName

    $vmg = get-VMGuest $vm

    $vmg | HostName, IPAddress, OSFullName FT

    Very well so far.

    Then I don't understand how get Host IE ESX Server where the virtual computer and the data store that is used by this specific virtual machine.

    If we see $vm | FL we see "docking" as one of the goods... I want that it should be displayed in my exit...

    $vmg | FT, OSFullName, IPAddress, $vm host name. Host? something like that? It did not work

    Even for the data store, if we see $vm | Get-data store, we get the name of the data store.

    Please help me with this, I don't need to an advanced script, a simple solution that can fit into what I'm trying to do here...

    You are tryingh mix properties of 2 variables in the cmdlet Select-Object/Format-Table 1.

    It does not work like that.

    But you can do

    $vm = Get-VM $VMName
    $vmg = Get-VMGuest $vm
    
    $vmg | FT HostName, OSFullName, IPAddress, @{N="Host";E={$vm.Host.Name}},@{N="Datastore";E={($vm | Get-Datastore).Name}}
    

    ____________

    Blog: LucD notes

    Twitter: lucd22

  • VERY simple shell script makes me crazy!

    I have a two-line shell script to take a snapshot of a virtual machine. The script works and a snapshot is taken with the correct name and description using the vmware-cmd command. But I get an error as if the script tries to run the two parts of the same line.

    CODE

    #! / bin/sh

    "vmware-cmd /vmfs/volumes/Storage1/roadrunner.cooper.local/roadrunner.cooper.local.vmx"_BackupShot_""for snapshot backups"createsnapshot 1 0'.

    OUTPUT

    #./backup.sh

    . / backup.sh: line 3: createsnapshot (_BackupShot_,: command not found)

    I'm no expert in shell script, but I don't understand why this error occurs when the command runs perfectly!

    Thanks for any help!

    I would then use the backtick?

    In this case Yes, or you can also use:

    variable = $(ligne de commande)

    André

Maybe you are looking for