Publish multiple values to the databus from a PowerShell script

Hello, I’m hoping someone may have a good suggestion on how to pass data from a child powershell process to the parent process in a fashion that Orchestrator can publish on its databus.  So I have the below script, where I have to call a child powershell
session because the activity that run the script natively only opens a powershell 2.0 session, so for the cmdlets I want to use we have to call a child session that will open in PS version 4.  The problem I seem to be running into is that the new object
is a hash table and it appears if there is more than one value the Orchestrator databus doesn’t like it.  Perhaps there is a better way.  I can get a clean result if the script only returns one value.
$VAR
= PowerShell {
CD
HFH:
$DirRules
= Get-CMDeviceCollection
-CollectionId 'SMS110101'
$Names
= $DirRules.CollectionRules
| Select
RuleName
New-Object
pscustomobject -Property @{
Rules
= $Names
$List = $VAR.Rules
$Results = $List.RuleName
$Results

Hi,
if $Results has multiple values you can get each result if you add after your code:
#... You're code from before ...
$Result=@()
foreach ($Item in $Results)
{$Result += $Item
Then define Result as Published Data in the "Run .Net Script" Activity".
Regards,
Stefan
www.sc-orchestrator.eu ,
Blog sc-orchestrator.eu

Similar Messages

  • I am facing a problem in passing multiple values as out parameters from fo

    Hi All,
    i am facing a problem in passing multiple values as out parameters from for loop.
    EX:
    i have a select statment inside a loop like.....
    PACKAGE SPEC:
    create or replace PACKAGE EMP_PKG AS
    TYPE TAB_NUM IS TABLE OF SCOTT.EMP.EMPNO%TYPE;
    TYPE TAB_NAME IS TABLE OF SCOTT.EMP.ENAME%TYPE;
    TYPE TAB_JOB IS TABLE OF SCOTT.EMP.JOB%TYPE;
    temp_table TAB_NUM;
    procedure test(temp_TAB_e_no OUT TAB_NUM,
    temp_TAB_e_name OUT TAB_NAME,
    temp_TAB_e_job OUT TAB_JOB);
    END EMP_PKG;
    PACKAGE BODY:
    create or replace PACKAGE BODY EMP_PKG AS
    v_e_no NUMBER;
    procedure test(temp_TAB_e_no OUT TAB_NUM,
    temp_TAB_e_name OUT TAB_NAME,
    temp_TAB_e_job OUT TAB_JOB) IS
    BEGIN
    select EMPNO bulk collect into temp_table from emp;
    for i in 1..temp_table.count loop
    v_e_no := temp_table(i);
    select empno,
    ename,
    job
    into temp_TAB_e_no(i),
    temp_TAB_e_name(i),
    temp_TAB_e_job(i)
    from emp
    where empno = v_e_no;
    end loop;
    end test;
    END EMP_PKG;
    PROBLEM FACING IS:
    I am expecting all rows returning from bellow select statment ...
    select empno,
    ename,
    job
    into temp_TAB_e_no(i),
    temp_TAB_e_name(i),
    temp_TAB_e_job(i)
    from emp
    where empno = v_e_no;
    But,while running the SP , i am getting error like
    ORA-06531: Reference to uninitialized collection
    ORA-06512: at "SCOTT.EMP_PKG", line 16
    why i am not getting all values as out parameters.please provide a solution for me.
    Thanks in advance my friend.

    user9041629 wrote:
    Hi All,
    i am facing a problem in passing multiple values as out parameters from for loop.
    EX:
    i have a select statment inside a loop like.....
    PACKAGE SPEC:
    create or replace PACKAGE EMP_PKG AS
    TYPE TAB_NUM IS TABLE OF SCOTT.EMP.EMPNO%TYPE;
    TYPE TAB_NAME IS TABLE OF SCOTT.EMP.ENAME%TYPE;
    TYPE TAB_JOB IS TABLE OF SCOTT.EMP.JOB%TYPE;
    temp_table TAB_NUM;
    procedure test(temp_TAB_e_no OUT TAB_NUM,
    temp_TAB_e_name OUT TAB_NAME,
    temp_TAB_e_job OUT TAB_JOB);
    END EMP_PKG;
    PACKAGE BODY:
    create or replace PACKAGE BODY EMP_PKG AS
    v_e_no NUMBER;
    procedure test(temp_TAB_e_no OUT TAB_NUM,
    temp_TAB_e_name OUT TAB_NAME,
    temp_TAB_e_job OUT TAB_JOB) IS
    BEGIN
    select EMPNO bulk collect into temp_table from emp;
    for i in 1..temp_table.count loop
    v_e_no := temp_table(i);
    select empno,
    ename,
    job
    into temp_TAB_e_no(i),
    temp_TAB_e_name(i),
    temp_TAB_e_job(i)
    from emp
    where empno = v_e_no;
    end loop;
    end test;
    END EMP_PKG;
    PROBLEM FACING IS:
    I am expecting all rows returning from bellow select statment ...
    select empno,
    ename,
    job
    into temp_TAB_e_no(i),
    temp_TAB_e_name(i),
    temp_TAB_e_job(i)
    from emp
    where empno = v_e_no;
    But,while running the SP , i am getting error like
    ORA-06531: Reference to uninitialized collection
    ORA-06512: at "SCOTT.EMP_PKG", line 16
    why i am not getting all values as out parameters.please provide a solution for me.
    Thanks in advance my friend.Probably not a bad thing that this isn't working for you.
    This is a horrible way to return the contents of a table.
    Are you doing this for educational purpose, or ... what is your goal here? If you just want to return a result set to a client you'd want to look in to using a REF CURSOR and not a bunch of arrays combined with horribly procedural (slow) code.

  • Date range to be displayed  & Displaying multiple values on the report

    Hi,
    I have date range parameters, but I also need it to be displayed it on the report. Is there any way I can display it. E.G If a parameter is created one can drag and drop it on the report if it needs to be displayed on the report, I tried to do the same for the date range parameter but it does not work.
    Also If a parameter is created by selecting the option 'Allow Multiple Values', and if you drag and drop it on the report only the first value is displayed and the rest does not show. Has anyone tried this before and been successful in displaying multiple values in the report.
    Thanks in advance.

    Hi,
    A multi-value parameter is actually treated as an array in Crystal Reports.
    To display the values selected in the parameter, create a formula from the Field Explorer and type this code:
    Join({?ParameterName},",");
    Place this formula on the header or the footer sections of the report.
    Regarding the date range issue, please follow Sastry's advice and it should work fine.
    Make sure you're using the parameter in the Minimum and Maximum functions. For eg: If I was to create a date range parameter called OrderDate, my formula to show the start date would look like this:
    Minimum({?OrderDate})
    -Abhilash

  • Multiple value variable - not showing Multiple values in the report

    Hi,
    I have careated a Multiple value variable for one of the characteristics in my Query. however, When i run the Query and select multiple values for the same, the report displays values for only the first selection.
    Could you help me resolve this ?
    Rgds
    Shweta

    Hello Shweta,
       Are you running the report in the Analyzer excel or Web?
    May be you can check the following:
    1. Use the latest FEP. It is working for me.
    2. May be the other values that you selected do not have corresponding keyfigures values. Hence it is showing only the first one.
    Try selecting other values ( except first one selected this time )
    Regards,
    Sheik Bilal

  • Passing multiple values to the QUERY BDOC parameter?

    hi All,
    Below is my Query BDOC Anchor Before Query Execute even handler... I'm trying to pass multiple values to the         bq.Z_PartnerFunction query parameter... i.e. 
    PARTNER_FCT in( '00000012','ZDIVMGR','ZAREADR')
    is it possible without creating new Query Bdoc ?
    ====================================
    Private Sub aempchoicewinTCWSearchTAnchor_beforeQueryExecute(ByRef bq As BusinessQuery, ByRef cancel As Boolean)
    If Not bq Is Nothing Then
            If sWcDummy = "Yes" Then
                    bq.WcDummy = sWcDummy
            End If
            bq.Z_PartnerFunction = "00000012"
            If ctrlZ_Territory.Value <> "" Then
                 bq.PRNB_TerrID = "*" & ctrlZ_Territory.Value
            End If
    End If
    End Sub
    ================================
    Thanks in advance
    Hetal

    Hi,
    it looks that you already enhanced the query BDoc because you have a new query parameter bq.Z_PartnerFunction, right?
    To which BDoc parameter is this BQ parameter mapped? And how looks the related where clause?
    For a single filter normally a "=" operator is used. Therefore your example with "in" won't work.
    If these three partner functions are fixed then you might hardcoded them directly in the where clause (supposed the BDoc is not used somewhere else where you don't want to have this filter).
    Or you might add 3 new BDoc parameters, add 3 new where clauses using a disjunction for them (and using an embracing bracket). In this case always all these 3 BQ parameters need to be filled (or all stay empty) to avoid a SQL syntax error.
    Regards,
    Wolfhard

  • Multiple values for the Parameter

    1. Had any tried the selecting MULTIPLE values for the parameter in Oracle Discoverer Plus Releae 4.1 Version 4.1.37.00.0. If so can please let me know how to implement it.
    2. In a Page-Detail Cross Tab workbook, I have to show the weighted average instead of the avg or sum. Any inputs please.
    3. I have to compare two periods (TOP) of datapoints. Any inputs please.

    If you wanted to eliminate the need for users to type in the parameter values, you could create a LOV on the desired column. This will produce a distinct list of all valid values where the user would simply select as the wish. Of course you still need to check the "let user enter multiple values" checkbox if you want them to select more than one.
    -DG

  • Getting the output from a Perl script using Runtime.exec

    I cannot get the output from a perl script using Java. Can someone PLEASE help?
    I used the following code:
    Process p = Runtime.getRuntime().exec("C:\\Perl\\bin\\Perl.exe script.pl) ;
    InputSream in = p.getInputStream();
    b...
    do
    System.out.println(b);
    while ((b = in.read()) > 0)
    But there is no way that I get the output in the inputstream. If I use the command "cmd script.pl", the output is displayed in the Dos box, but also not in the inputstream.
    I will appreciate any help.

    Try this
    Process p = Runtime.getRuntime().exec("C:\\Perl\\bin\\Perl.exe script.pl) ;
    BufferedReader rd = new BufferedReader(new InputStreamReader(p.getInputStream()));
    String str;
    while((str=rd.readLine())!=null){
    System.out.println(str);
    Manu

  • How to run .cmd file from a Powershell script

    Hi,
    I would like to know how I run commands from a powershell script? how to use the invoke-command?
    This powershell script doesnt work for me
    Invoke-Command C:\setup.cmd -ArgumentList install-setupforced

    To run a batch file from powershell, just type its name with arguments. I'd recommend explicitly including the .CMD file type and, if it is located in the current folder, powershell rules require you to explicitly say so, i.e.:
       ./mybatch.cmd inputfile.txt outputfile.txt
    To run a single cmd.exe command, just prefix it with cmd.exe /c as Mike says:
        cmd.exe /c color 48
    to run a series of "&"- separated cmd.exe commands you need to enclose the complete command string in double quotes:
        cmd.exe /c "color 37 & dir"
    Beyond that it can get complicated due to various characters that are special to powershell and those special to cmd.exe. If you need to run a series of cmd.exe commands, your best short term bet is to put them in a batch file. The best long-term bet is
    to move more completely to the powershell way of doing things...
    Al Dunbar -- remember to 'mark or propose as answer' or 'vote as helpful' as appropriate.

  • How to display(binding) values in the table from more than one node?

    Hi,
    I have two nodes (TRIPS & AMOUNTS)in the context. How to bind these values into the table control?
    When i bind second one, first one is getting replaced.

    Hi Mog,
    Of course it is possible to create a table from attributes of more than one node, and in some cases this is still necessary, but you have to do this the hard (manual) way.
    If you have a table control, have a look at the properties and the elements belonging to it.
    First of all, there is the property "dataSource", which binds to a multiple node (let's name it TableRootNode). This means that for each element of THIS node, one row is created. In each row the data of exactly one element of this TableRootNode is displayed.
    Then you have columns in this table. Inside of the columns there is a header and an editor. The editor is the interesting part.
    Normally the primary property of this editor is bound to an attribute of the TableRootNode. Then everything works as expected. If it binds to an attribute of a subnode (SUB) of TableRootNode, then in row i the data of the subnode of the i-th element of TableRootNode is displayed. There is no need for SUB to be a multiple node, but it must not be a singleton.
    If you bind a property of the editor to an attribute, which does not lie in the subtree of TableRootNode, then you will see the same value in each row.
    Now it depends on the structure of your context. Take the node, which is relevant for the change in each row (I assume it is TRIPS) and bind the table to the node as you are used to. Then for each additional column, you have to create a new column in the tree, create a new header element with a title and a new editor (e.g. textview or inputfield) and then bind the right property of the editor to the corresponding attribute in node AMOUNTS).
    If these 2 nodes do not have parent-child-relationship, the tip to create a new node, which consists of the attributes of both nodes is the only solution.
    Ciao, Regina

  • Lang Alt array - multiple values of the same locale

    I am working with Iptc4xmpExt, but this question might apply to any Lang Alt array. 
    For the property Iptc4xmpExt:AOTitle, I need to write multiple values to accommodate alternate versions of an artwork title.  Writing titles of different locales is no problem, but I can't find a way to write separate array values for the same locale.
    Example 1:
    <rdf:li xml:lang="x-default">Prize Vessel from the Athenian Games</rdf:li>
    <rdf:li xml:lang="x-default">Panathenaic Prize Amphora and Lid</rdf:li>
    Example 2:
    <rdf:li xml:lang="x-default">Pantheon</rdf:li>
    <rdf:li xml:lang="en-us">Pantheon</rdf:li>
    <rdf:li xml:lang=""it-it">Santa Maria ad Martyres</rdf:li>
    <rdf:li xml:lang=""it-it">Santa Maria Rotunda</rdf:li>
    I think the separateArrayItems should work for this, but it doesn't.
    event.xmpAccess.separateArrayItems("Iptc4xmpExt:ArtworkOrObject[1]/Iptc4xmpExt:AOTitle", _workTitle.text, IXMPConst.ARRAY_ALT_TEXT);
    <fi:XMPTextInputMRU id="_workTitle" xmpPath="Iptc4xmpExt:ArtworkOrObject[1]/Iptc4xmpExt:AOTitle" xmpType="Localized"/>
    Also, I would like to preserve commas and I have had trouble using the "allowCommas:Boolean  = true" parameter in the separateArrayItems method.
    As a note, I tried using a semicolon and comma to separate other Lang Alt properties such as the CS4 Description panel "Document Title" and the values were written as a single string not as an array.
    <dc:title>
                 <rdf:Alt>
                    <rdf:li xml:lang="x-default">ENGLISH TITLE 1; ENGLISH TITLE 2; ENGLISH TITLE 3</rdf:li>
                 </rdf:Alt>
              </dc:title>
    Thanks for any help you can give.
    Greg Reser

    Hi Greg,
    an alternative to store any amount of data in any XMP property is to use qualifiers.
    The advantage of qualifier is that they are very flexible and that thay are ignored if you do not specifically request them.
    Disadvantage is that they might also be overlooked and deleted by apps that are not aware of their existance.
    FileInfo would overwrite them when you modify the "Artwork or Object" table. But if you build your own panel it will be working.
    Regards,
    -- Stefan
    In this example, I attached two alternative italian titles to the main AOTitle (you can import this file as a template to try it out):
    <x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.0-c060 61.134777, 2010/02/12-17:32:00        ">
       <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
          <rdf:Description rdf:about=""
                xmlns:Iptc4xmpExt="http://iptc.org/std/Iptc4xmpExt/2008-02-29/"
                xmlns:q="http://alternativeTranslations">
             <Iptc4xmpExt:ArtworkOrObject>
                <rdf:Bag>
                   <rdf:li rdf:parseType="Resource">
                      <Iptc4xmpExt:AOTitle>
                         <rdf:Alt>
                            <rdf:li xml:lang="it-IT">
                                <rdf:Description>
                                    <rdf:value>Santa Maria ad Martyres</rdf:value>
                                    <q:alternativeTitles>
                                        <rdf:Seq>
                                            <rdf:li>Santa Maria Rotunda</rdf:li>
                                            <rdf:li>Santa Maria Rotunda 2</rdf:li>
                                        </rdf:Seq>
                                    </q:alternativeTitles>
                                </rdf:Description>
                            </rdf:li>  
                         </rdf:Alt>
                      </Iptc4xmpExt:AOTitle>
                   </rdf:li>
                </rdf:Bag>
             </Iptc4xmpExt:ArtworkOrObject>
          </rdf:Description>
       </rdf:RDF>
    </x:xmpmeta>

  • Problem with binding value on the UI  from a calculated column in the view

    I have calculated field "Readiness" in my db view, which gets calculated based on other columns in the same table. I have added new column to my EO using "Add from table" option and added the same column from to VO using "Add from EO" option. In my application, I will update a particular date field in the UI and this calculated column "Readiness" in the db will be set to yes or no and this logic is working fine, both date date field and calculated field are in same view object. I have added a attribute binding to this "Readiness" column in my view page. The problem is the calculated column value does not reflect the new value in the db, it shows the old value. I have tried different refresh option for the iterator and ppr option for the field binding. Even after reloading the page, the value shown on the UI page is different from the value in db, other bindings on the UI page works fine, not sure any special settings are required for the Calculated columns. any ideas are appreciated.
    Thanks for your help,
    Surya

    I tried to add soms debugging statements in the EO and getters method, the calcaulated column is not picking the value in db view. I'm not any special iterator/field settings are required at BC level. I'm a newbie, any help is appreciated.
    Thanks,
    Surya

  • Copy select value in the textfield from LOV and allow user to edit it

    Hi,
    I have a datablock with 20 records and each record has comments (say field_comments) fields. I would like to allow user to choose predefined comments populated from LOV (say lov_comments) and to append some extra comments after they choose the value from LOV.
    I have created a LOV and added Return type “field_comments” in the column mapping properties. When user clicks on a button, LOV opens up. They select the value from the LOV and the value goes to “field_comment” field. The problem with this approach, user can’t add their comment after selecting from LOV.
    I tried this way too. I created another non-visible textbox (say dummy). In the LOV, I added “dummy” field as returntype. In the dummy field, I have created “POST-CHANGE” trigger which basically says :block. field_comments = :block. Dummy.
    But, the user has to click on other field to view the selected value from the LOV. The values in the “field_comments” is not updated as soon as user click on “OK” button in the LOV.
    I would appreciate it if somebody could give me some input and help to solve my issue. Thank you for your help.
    Thank.

    Well, I tried exactly what you posted and it allowed me to SELECT from LOV and then CHANGE/APPEND new text in front of returned value in the field. It saved to the database and queried without any problems.
    Is your item allowed to INSERT/UPDATE ? If not, then set "Update/Insert Allowed" properties to Yes and attach your LOV to the item and set "Validate from list" to No.
    You may also see if you have any validation being performed on WHEN-VALIDATE-ITEM or POST-CHANGE trigger which will fail since you are editing the values populated from LOV.
    Hope it helps!

  • How can I create a hashmap() with multiple values for the same key?

    I am trying to write an application that will us something like a Map() with multiple values but some have the same key. Is this possible?

    i had the same question. just create a List, add all the values u want to it, and then put the List into the map like u would a normal single value. e.g.
    List list = new ArrayList();
    list.add(value1);
    list.add(value2);
    map.put(key, list);
    i bet u r doing the same course as i am =)

  • Values to the only from the F4 help (F4IF_INT_TABLE_VALUE_REQUES)

    Hi all,
    I am using FM: F4IF_INT_TABLE_VALUE_REQUEST  to get help values on one field. The values are getting from table for the F4 value. Now i am gettign f4 value to the field
    now my problem is, user has to enter the values only from the F4 value not other values. right now field taking other than f4 values if i enter.
    I can not use values table at the domain level as it is standard domain.
    can anybody help me on this

    mythily.guptha wrote:
    Hi all,
    >
    > I am using FM: F4IF_INT_TABLE_VALUE_REQUEST  to get help values on one field. The values are getting from table for the F4 value. Now i am gettign f4 value to the field
    > now my problem is, user has to enter the values only from the F4 value not other values. right now field taking other than f4 values if i enter.
    >
    > I can not use values table at the domain level as it is standard domain.
    >
    > can anybody help me on this
    this is discussed several times in the forums, the simple trick to first input disbale(screen-input = 0) the field in PBO/AT SELECTION-SCREEN OUTPUT using LOOP AT SCREEN and then force input into the disabled field by passing the value 'F' to the parameter 'DISPLAY' of the FM  F4IF_INT_TABLE_VALUE_REQUEST.
    -Rajesh.

  • To convert the values in the column from upper case to Camel Case.

    Hi All,
    I have requirement to convert the column values(Data in the Columns) from upper case to camel case in pivot table view.
    For Eg:
    I have
    Table Name:Billing_Transaction
    under Billing_Transaction table i Have column Comment_Text
    Data in Comment_Text Column is
    INSERT,
    EXPORT,
    AMEND
    How i will change these values in to Insert,Export,Amend.(Camel Case condition)
    I want only the first letter of a word to be in caps and others to be in smaller case.
    Thanks,
    Chitra Subramani.

    Hi Aravind,
    Thanks for immediate response.your query is helpful.But i need to satisfy another condition in my requirement by using same formula.
    "REPLACE(UPPER(SUBSTRING(BILLING_TRANSACTION.BILLING_TRANSACTION_DESC FROM 1 FOR 1)) || lower(substring(BILLING_TRANSACTION.BILLING_TRANSACTION_DESC FROM 2)), '_', ' ')"
    above query satisfying Camil case and replacing '_' with ' '(space)......but inthis query i want add another condition to satisfy camil case for word which comes after '_'
    for example:
    DECLINE_IMPORT
    above query satisfying 2 conditions to convert above data into
    "Decline import"
    But in my requirement for word 'import' also it should come in camil case condition like
    "Decline Import"
    Thanks & Regards,
    Chitra
    Edited by: user6371773 on Apr 25, 2011 6:29 AM

Maybe you are looking for

  • How do I add Picture to a Contact's Profile , not ...

    Evidently this has been previously asked and died on the vine. In My Family Contacts I have picture in iPhoto/Photos (mac) of them  I would like to add Photo when I open up their contact info there actually is a Place holder for a Picture. But now wa

  • How to use Java Script in Oracle Forms 10g

    Hello, Appreciate if anyone could help me using Java Script in Oracle Forms 10g? Thanks GM

  • IDOC to Flat File and XML ( Need both the Output)

    Hi , My Scenario is IDOC to File . I need o/p in 2 format . ie,    1) Flat File 2 ) XML file I have a plan to go with Interface determination , 2 IM and what shd be the condition ? or Else  2 Receiver detmination  but condition ? How to slove this ?

  • Showing tiff files using web.show_document

    Hello, I want to show tiff files using web.show_document. Tiff files cannot be displayed in a browser, however therr are several plug-ins available to show them. Can anyone recommend a plugin to display tiff files in a browser? Kind Regards Erik

  • Read metadata of jpeg

    hi guys: I have a problem about using ImageReader.reader.getImageMetadata to fetch metadata from a jpeg file . Unfortunately, i got such error Exception in thread "main" javax.imageio.IIOException: ICC APP2 encountered without prior JFIF! It seems li