Question of function parameter

OK, I have a function where I am going through a lot of vmhosts, but when I spend say get-vmhost for guests and print the $vmobject it only lists the first object.  What Miss me about the parameter part?

function {} host_info

(param

[CmdletBinding()]

[Parameter (Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelinebyPropertyName = $True)]

$VMObject

)

$vmobject

}

Hello, markdjones82-

Regarding the part parameter $VMHostObject Parameter(), you are not missing anything that is causing this behavior.  The 'missing' thing is the scriptblock {} in the body of the function.  To get it to behave like you want to, you must add a such scriptblock.  See the example below based on your initial function: he writes messages documented in each of the scriptblocks Begin, process, and end.  This is so that you can see the difference when you use the function with either a direct value by passing (to a param) or with values from the pipeline.

function Get-VMHostInfo {    [CmdletBinding()]    Param (        [Parameter(Mandatory=$true,ValueFromPipeline=$true,ValueFromPipelinebyPropertyName=$true)]        $VMHostObject    )    begin {Write-Verbose -Verbose "starting; this 'begin' scriptblock only runs one time, and, if a pipelining example, this is before any param variables have values (see:  the value of `$VMHostObject is '$VMHostObject')"}    process {        Write-Verbose -Verbose "in the process scriptblock, either once (non-pipeline example) or for each value passed in a pipelining example"        $VMHostObject    }    end {Write-Verbose -Verbose "in the 'end' scriptblock, and only once"}}

When you take values from the pipeline, is an 'Advanced' function that PowerShell believes that it is, and the advanced functions behave a little differently.  To see the differences, to call this function in one of the following ways and verbose messages as well as the output objects must light up.

## non-pipeline example:  should have just three verbose messagesGet-VMHostInfo -VMHostObject (Get-VMHost myhosts.*)

## pipeline example:  should have larger number of verbose messages:##   one for begin{}, one for every VMHost in the pipeline, and one for end{}##   and, the value for VMHostObject in the verbose message in the begin{} should be emptyGet-VMHost myhosts.* | Get-VMHostInfo

And the suggestion to the name of the function: use standard PowerShell verb-noun, for consistency, attractiveness, etc..  In addition, you can learn more about methods of treatment of function entry in the help topic for about_Functions_Advanced_Methods (Get-Help about_Functions_Advanced_Methods).

How does do for you?

Tags: VMware

Similar Questions

  • Can I make a class as a function parameter type?

    Thus, AS2, I had a function that would create a different movieclips based on variables, that I went in (because attachMovie() took the name of the movieclip as a string - for example attachMovie("man",...) or attachMovie ('car'...)).

    In AS3, it did more correctly now, with a new var = Man() mc or new Car().

    Is there a way for me to pass the type of class (man or car) as a function parameter to a function:

    for example

    public void MakeMovieClip(classType:<something>):MovieClip {}
    return new classType();
    }

    or do I have to do basically a block giant switch/case that switches from channels (which is what I currently do)?


    Thank you

    --
    Ken

    If you have a library item with the name of the man class, use the following code to add a movieclip Man to the scene.

    Learn more about this here.

  • simple question to function test of value chain

    Hey guys,.

    I m just started using teststand.

    My simple question is related to the function "test string value '. What is the difference between the "type of comparison' CASE SENSITIVE and IGNORE CASE? From my point of view are not really meaningful names.

    To avoid simple and stupid questions like that, I tried to use the internal helper function. I'm wrong when I say that the help features are not as good as in labView? I couldn t find any answer to my question... hmmm... How other people handle this situation? (outside of just trying?)

    Thanks for your help

    Hello

    Case SENSITIVE: it will fail if you compare "HELLO" with 'Hello' or 'A' with 'a '.

    IGNORE CASE: this will pass if you compare "HELLO" with 'Hello' or 'A' with 'a '.

    Hope that explains

    Jürgen

  • Question about function

    Dear After Effects community, I'm doing something wrong. I started with the example of skeleton and changed to what I thought, I want it to do, however, it does not work. I changed the "MySimpleGainFunc8" and "MySimpleGainFunc16" to look like this:

    () MySimpleGainFunc16

    void * Conref.

    A_long xL,

    A_long yL,

    PF_Pixel16 * inP,

    PF_Pixel16 * output)

    {

    PF_Err err = PF_Err_NONE

    TempR PF_FpLong = 0;

    PF_FpLong tempG = 0;

    PF_FpLong TempB = 0;

    Output->alpha = inP->alpha;

    Output->Red ->Red + tempR inP = * 0.5;

    Output->Green = inP->Green + tempG * 0.5;

    Output->Blue = inP->Blue + tempB * 0.5;

    tempR = inP->Red + tempR * 0.5;

    tempG = inP->Green + tempG * 0.5;

    tempB = inP->Blue + tempB * 0.5;

    return err;

    }

    Now, what I want to do, it's for each image, the color of each pixel in the previous image should be averaged with the color of each respective pixel in the active frame. The function that I put in place now does not seem to work properly. When I apply the effect to a composition, nothing happens at all. Can someone please help me try to understand where I'm wrong. Thanks in advance!

    I find it difficult to follow what exactly is happening there, but it seems that you are a little confused as to how the functions are defined, and where should things go exactly.

    In your header file (formerly skeleton.h):

    -Set your RenderData structure:

    struct RenderData {}

    PF_EffectWorld * prev_frame_world;

    };

    (It is noted here that you can put what you want in this struct - everything you may need to access in your function iterate).

    In your main file (formerly skeleton.cpp):

    -Set your sampler of pixel outside any other function:

    Inline PF_Pixel * sampleIntegral32 (PF_EffectWorld & def, int x, int y) {}

    return ((char*) def.data (PF_Pixel *) + (y * def.rowbytes) + (x * sizeof (PF_Pixel)));

    }

    (Note that I used 'inline' rather than 'static' - this will give you a hint to the compiler to Inline the contents of the service where you call SampleIntegral32 directly, but you can use static, if you want. For some reason, you had declared it as static PF_Err, which returns a PF_Err, rather than the PF_Pixel *)

    -Your iterator or several functions:

    () MySimpleGainFunc8

    void * Conref.

    A_long xL,

    A_long yL,

    PF_Pixel8 * inP;

    PF_Pixel8 * output)

    {

    PF_Err err = PF_Err_NONE;

    RenderData * render_data = reinterpret_cast(prevframe);

    PF_Pixel * p_prev_frame = sampleIntegral32 (render_data-> prev_frame_world, xL, yL);

    Output-> alpha = (inP-> alpha) + p_prev_frame-> alpha * 0.5; I think that's what you wanted to do, no?

    etc...

    return err;

    }

    -Your function of rendering:

    PF_EffectWorld is exactly the same as PF_LayerDef. You withdraw your OK setting (even if the parameter ID "SKELETON_GAIN" is probably a cursor rather than the input layer. You can use 0 (zero) here, as the first parameter is always the PF_EffectWorld of entry, but read on, the first param is the enum SKELETON_INPUT, so we will use.

    PrevFrame PF_ParamDef = {};

    ERR (PF_CHECKOUT_PARAM (in_data,

    SKELETON_INPUT,

    in_data-> current_time - (1 * in_data-> time_step), / / I think it's a good...

    -> time_step in_data,

    in_data-> time_scale,

    & prevframe));

    When you go wrong here is that you are trying to make a PF_ParamDef to a PF_EffectWorld in your render data. You must point the layer data instead:

    RenderData render_data;

    render_data.prev_frame_world = & prevframe.u.ld;     Point your def of layer prev_frame_world pointer in the union

    ERR (suites. Iterate8Suite1()-> iterate (in_data,

    0, / / basic course

    output-> height, / / final course. Use linesL if you set as on the skeleton model

    & params [SKELETON_INPUT]-> u.ld, / / src

    NULL, / / area - null for all pixels

    (void *) & render_data, / / Conref - your custom data pointer

    MySimpleGainFunc8, / / function pixel pointer

    output));

    Check in this setting!

    Err2 (PF_CHECKIN_PARAM (in_data & prevframe));

    And it should work I think! It's not tested, but the basics are there.

  • function parameter

    Hello

    There is a function which converts a time in the format YYYY-MM format YYYYMM, and it works.

    I am trying to execute the function with a parameter that is built in a sql statement, but I get an error "Missing Expression".
    -----
    The funtion itself is written (for example):

    Select apps.jafi_disco_utils_pkg. Jafi_Get_Alt_Period ('03-2010 ")
    the double (the result is 201003)

    ------
    The following statement gives a result of ' 03-2010 ":

    Select to_char ("'| min (glb_FromDate2.Period_Name) |") ')
    of gl.gl_balances glb_FromDate2
    where glb_FromDate2.code_combination_id = 566014 and
    actual_flag = "A".

    -----

    When I try to combine the two, I get the error ORA-00936: lack of expression:

    Select apps.jafi_disco_utils_pkg. () Jafi_Get_Alt_Period
    Select to_char ("'| min (glb_FromDate2.Period_Name) |") ')
    of gl.gl_balances glb_FromDate2
    where glb_FromDate2.code_combination_id = 566014 and
    actual_flag = "A".
    )
    of the double

    -----
    Can someone help me with what is wrong? What expression I'm missing?

    Thank you.
    Leah

    You need something like:

    SELECT apps.jafi_disco_utils_pkg.Jafi_Get_Alt_Period (period_name)
    FROM (SELECT MIN( glb_FromDate2.Period_Name) period_name
          FROM gl.gl_balances glb_FromDate2
          WHERE glb_FromDate2.code_combination_id = 566014 and
                actual_flag='A')
    

    or maybe:

    SELECT apps.jafi_disco_utils_pkg.Jafi_Get_Alt_Period (MIN( glb_FromDate2.Period_Name))
    FROM gl.gl_balances glb_FromDate2
    WHERE glb_FromDate2.code_combination_id = 566014 and
          actual_flag='A'
    

    You need not use quoted string settings when you pass them as variables (or columns in a table).

    John

  • Question of function @PRIOR

    Hi all, please explain me using @prior function (Member, offset, list of beaches)
    If I understand well here:
    members - only one Member, we want to return the value of
    Offset - number of periods/some_members of the list of beaches
    list of beaches - choose members for offset

    said, we are accountable
    ACC0
    Acc1
    ACC2

    How should I set the formula with the function @PRIOR if I want to calculate:
    (1) acc2 = acc1 from previous months of N, where N is stored in acc0
    (2) acc2 = acc2 in the previous months of N, where N is stored in acc2 in custom_member2 of custom_dimension2

    Have you tried that?

    "ACC".
    (
    "ACC" = @PRIOR ('ACC_VALUE', 1, "YearTotal");
    )

    Does it work?

    Have you tried that?
    "ACC".
    (
    IF ("ACC_PERIOD" == 1)
    "ACC" = @PRIOR ('ACC_VALUE', 1, "YearTotal");
    ENDIF
    )

    My question is this: your formula works by itself, or it is not? If she's not going without the IF, it is not likely to work next to YEW.

    Kind regards

    Cameron Lackpour

  • An array of strings as function parameter in loop fails

    Hallo,

    I have a weird problem here and I hope someone can help me find the cause.

    I have a function where I said an array of strings (string_list). I pass the array to a function that does modifactions to the table. I am addressing Walker the array of strings to an index of all the values are stored correctly. When I loop through the array by incrementing the index automatically only the last index value are saved in all positions.

    Why is this? Or what I am doing wrong?

    It is the passage to another function, an array of strings
    int calling_function
    {
    char * string_list [MAX_PATHNAME_LEN]; //< store="" strings="" in="">
    function_called (string_list); passing a pointer to an array of string
    return 0;
    }

    This is the function receives a reference to an array of strings to store data
    int function_called (char * output_list [])
    {
    int i = 0; counter variable
    / * This works and good values are stored in output_list * /.
    output_list [0] = '02 ";
    output_list [1] = '12 ';
    output_list [2] = "22";
    output_list [3] = "32";
    output_list [4] = '42 ';
    output_list [5] = "52";
    output_list [6] = '622 ';
    output_list [7] = "72".

    / * This does not work and will store '31' in all places of the matrix * /.
    < 32="">
    {
    < %d »,="" i) ;="" incrémenter="" la="" valeur="">< br=""> output_list [i] = sample; < br=""> i = i ++ ; < br=""> < br="" >="">

    output_list [0] = '02 "; < br=""> output_list [1] = '12 ';< br="" >="">

    Thanks!

    Hi,.

    When you do

    output_list [i] = sample;

    all of the members of the array have the same value: sample-a char pointer. You are modifying the afterwards glad of sample purpose the previous values still point to sample.

    If you assign values to each array member like:

    you assign different values: a pointer to a string containing "02", pointing to a string contaning "12",...

    If you want to assign values in a loop you need to allocate memory for each string (output_list [i]) and copy the content of sample in them.

    Does this make sense to you?

    Constantin

  • question of functions call listItemComponent

    Hi all, how to call the function (which is defined outside the ListView) in listItemComponent?

    Container {
        id: cont
        function getColor() {
            return Color.Black
        }
        ListView {
           id: colorList
           listItemComponents: [
               ListItemComponent {
               type: "listItem"
               Container {
               id: item
               background: ???.getColor();
    

    If you want to do this, you need a double function call

    Container {
        id: cont    function getColor(){        return Color.Black;    }
        ListView {
           id: colorList       function getColor(){           return cont.getColor();       }
           listItemComponents: [
               ListItemComponent {
               type: "listItem"
               Container {
               id: item
               background: item.ListItem.view.getColor();
    
  • Question about functions in pipeline

    Version: Oracle Database 11 g Enterprise Edition Release 11.2.0.2.0 - 64 bit Production

    Hello

    I have a Pipelined function is used in a 4.1.1.00.23 APEX application. The function should return an array object to use in the WHERE clause of the query. So far, all of the values used in the function have been digital. Now, I have alphanumeric values and I get an error 'Character of digital Conversion'.

    A Pipelined can only use digital data?

    The function of reference is:

    FUNCTION to CREATE or REPLACE get_list (p_string in VARCHAR2
    , p_delimiter IN VARCHAR2 DEFAULT ':'
    )
    RETURN vc_array_1
    PIPELINED

    IS

    l_array wwv_flow_global.vc_arr2; -Creates a table type.

    BEGIN

    l_array: = APEX_UTIL.string_to_table (p_string, p_delimiter); -API to separate a delimited string colon by in a table.

    BECAUSE me IN l_array. FIRST... l_array. LAST
    LOOP
    LINE (TRIM (l_array (i)));
    END LOOP;

    RETURN;

    END;

    I thought that, given that the parameters are of type VARCHAR2 passing a valid value could be used. Apparently, I'm wrong?

    The WHERE clause that is used is in the format:

    ...

    WHERE < column_name > IN (SELECT * FROM TABLE (get_list (: P127_BASELINE_INIT_NAME)))

    ...

    If only the digital data can be used, how to use alpha-numeric values?

    Thank you

    Joe

    Stako, Anton and Jason thanks for your help!

    While I was waiting for my company to get the security put in place so that I could use sqlplus I was talking about this problem with another developer and it turns out that the function had NOTHING to do with this problem.

    It was all the me. The values passed into the function is from a Select list that allows multiple selectable values and this is whence the colon delimited string.

    IF no value is selected, it is a default value that can be used to not limit the number of rows in the WHERE clause. I used a 0 (zero) as a return value, so as the data type of the column is VARCHAR2 he compared a numeric character; where the error.

    The "bug" has been corrected and of course no error!

    Thank you all again!

    Thank you

    Joe

  • Question of function-based Index

    Hello Experts,

    I am wondering something simple relating to the funcion according to index. Lets say I have a FBI something like the following.

    CREATE INDEX idx my_fbi ON my_table (substr (nls_lower (my_column),1 25));

    Maybe it's a very basic question, but SERIOUSLY, I want to know. My question is, when I use this index, including the rating should I use other side of the equal sign? and WHY?

    SELECT * FROM my_table WHERE substr (nls_lower (my_column),1 25( ) = 'ali';

    OR

    SELECT * FROM my_table WHERE substr (nls_lower (my_column),1 25) = substr (nls_lower ("ali"),1 25( );

    Thank you 1 million for your great comments.

    Best regards

    Charlie

    using value once the '=' sign would be more effective if you already know the value because in this case Oracle does not need to evaluate the expression, but if the values are not known, then you have to use the expression.

    Exact values are more efficient than expressions, especially when the expression is already evaluated and it must be evaluated at run time.

    Onkar

  • Question: Assign a parameter to 'Open URL' in a shared Action?

    Hello

    Is it possible to assign a parameter to the action Open a URL in a shared Action ?

    open_url_parameter.png

    Thank you


    Peter

    Cardiff (clear, but rain forecast)

    In Wales

    UK

    Not as far as I know. Only the parameters are mandatory (objects, groups and slides) and candidate settings (variables and literals). The argument to the command open an URL is not in this list. The argument is the same level as the arguments indeed apply: only the object will be a parameter, not the effect itself, or the beginning and the duration of this effect (if you're the CP9).

    I'll repeat an old feature request here: If we were able to use the concatenation of such a command... .the URL that can be stored in a variable.

    Your goal can be achieved with JS.

  • Question about function table in pipeline

    I did an object:
    CREATE TYPE FML_DAT_ITEMS_OBJ AS OBJECT ("F0"      varchar2(4000), ...
    Then I did an object table:
    create or replace type fml_dat_items_ftab is table of FML_DAT_ITEMS_OBJ
    Everything is fine!

    Now, I want to do the function pipeline:
    create or replace 
    FUNCTION get_fml_items_dat (pfml_nr in number) return fml_dat_items_ftab pipelined as
      
       out_rec FML_DAT_ITEMS_OBJ := FML_DAT_ITEMS_OBJ() ;
       
      begin
         select item_dat into out_rec."F0" from fml_dat_items where fml_nr = pfml_nr and item_nr=   0.00;
         pipe row (????); -- HOW can I pipe the object to the function result set?
    Published by: Walter on 14.05.2013 05:29

    Hello

    Try this:

    create or replace type FML_DAT_ITEMS_OBJ AS OBJECT
    (
    f_name varchar2(20)
    ,l_name varchar2(20)
    )
    ;
    
    create or replace type fml_dat_items_ftab as table of FML_DAT_ITEMS_OBJ
    ;
    
    select
      *
    
    from
      table(fml_dat_items_ftab(FML_DAT_ITEMS_OBJ('peter', 'zwan')
                              ,FML_DAT_ITEMS_OBJ('peter', 'zwan')
                              )
            )
    ;
    F_NAME               L_NAME
    -------------------- --------------------
    peter                zwan
    peter                zwan                 
    
    create or replace
    FUNCTION get_fml_items_dat (pfml_nr in number) return fml_dat_items_ftab pipelined as
    
    --   out_rec FML_DAT_ITEMS_OBJ := FML_DAT_ITEMS_OBJ() ;
      out_rec FML_DAT_ITEMS_OBJ ;
    begin
       select FML_DAT_ITEMS_OBJ('peter', 'zwan') into out_rec from dual;
    
      for i in 1 .. pfml_nr loop
        pipe row (out_rec);
      end loop;
    
    end get_fml_items_dat;
    /
    
    select
      *
    from
      table(get_fml_items_dat(2))
    ;
    
    F_NAME               L_NAME
    -------------------- --------------------
    peter                zwan
    peter                zwan                 
    

    Hope this helps,

    Kind regards

    Peter

  • Question of function error 1006

    Hi I'm new to actionscript. I'm trying to resize a movieclip when I click on it and I get the following error:

    TypeError: Error #1006: value is not a function.

    at Untitled_fla::MainTimeline/resize_fn()

    Here is my code

    import flash.events.MouseEvent;

    import flash.display.MovieClip;

    circle.addEventListener(MouseEvent.ROLL_OVER,size_fn,false,0,true)

    circle.addEventListener(MouseEvent.ROLL_OUT,resize_fn,false,0,true)

    function size_fn(e:MouseEvent):void {}

    Circle.Width (3);

    Circle.Height (3);

    }

    function resize_fn(e:MouseEvent):void {}

    Circle.Width (1.1);

    Circle.Height (1.1);

    }

    no idea what I am doing wrong?

    Thanks in advance

    Chamces are that the problems are where you treat the width and height as functions rather than the properties...

    Circle.Width (3);

    Circle.Height (3);

    normally, you assign values to the width and height properties, they are not functions.

    Circle.Width = 3;

    Circle.Height = 3;

    but I suspect you weren't their definition to these small values may be that you're trying to scale them?  (If Yes use scaleX and scaleY instead of the width and height properties)

  • question about function in one of the CC of economics programs

    At work, I use a PC and at home, I use an Imac. When I work on my PC, for example Illustrator and use the Save as function to keep the old file and create a new version with the last correction. As soon as I clicked on save as and name the new file that I find myself with the new file in the window of my illustrator. So that I can continue to work on the new file without overwriting the original. However on my Imac I always find myself with the original, and the new version is stored whenever I taped. Several times I clicked Save I think I work in a new file and then lost my original CD. How can I change the settings so that when I choose to save as the new file replaces the Moose and Moose is stored safely? I consulted a few other mac owners and none have the same setting. Anyone know if this is a setting that I can change?

    Thank you!

    Looks like you're confusing 'Save a Copy' and 'record under. At least on Mac 'Save a Copy' leave the original file open while 'record under"let the newly named file open.

  • Question about functionality

    One of my requirements is to create. PNG files with transparent backgrounds incorporating images imported with deleted circles usung the Tools eraser and brush. Is this possible using elements? If this is not the case, what product (s) of the suite, Adobe will provide this feature? Thanks in advance

    Yes it can. You use the "Save for Web" feature, select PNG (8 or 24 bit) and check the box 'transparency '. There are a variety of tools that can be used to remove the background, including a conveniently called "gum background."

    See you soon,.
    --
    Neale
    Insanity is hereditary, get you your children

    If this post or by post from another user solves the original problem, please mark as correct and/or useful messages accordingly. This helps other users with similar trouble getting answers to their questions more quickly. Thank you.

Maybe you are looking for

  • Are my system or RAM faulty graphics card RAM? MacBook Pro crashes several times a day.

    Any time I see pictures, usually after several system crashes and restarts automatically. Because that's when I'm viewing images, it leads me to believe the graphics card or RAM is a failure. System is about 6 years old now. Here are the accident rep

  • HARD drive caddy for old Satellite Pro A10 need

    Hello I recently bought an old Pro of Satellite A10 but it doesn't have a hard drive or a caddy, anyone know if one of the other Toshiba Notebook Caddy is compatible with this model? I've been watching autour fleabay, but not a lot of Pro A10 caddy o

  • Satellite L305D-S5581 - dead BIOS

    Hi all, I have a Toshiba laptop Satellite L30D S5581. The screen kept going all the time and research in some forums, he suggested that I update the Bios to 1.5 to 1.7At halfway through the update, the screen went off and now when I turn it on it's j

  • X 200 with ssd OCZ blue screens at the start of the docking station

    The 200 x blue screens when the startup of the docking station. If I take the laptop to the docking station to start and then once booted dock the laptop is fine. The issue started happening when you I upgraded the laptop form a SSD OCZ vertex 2 driv

  • my desktop icons to expand...

    I had played a gta sanandreaz game... last week at this time, all of a sudden the power goes out OFF... after I restarted my computer, the icons are getting bigger and I m not able to work on my conputer... I think that viruses... I scanned the whole