Nested variable help

Hi,
I have looked around and been unable to find an answer, if one already exists I apologize in advance.
I have a menu built in powershell for use from the CLI, but need help in properly nesting variables and then reading them back.
I create a variable to store systems from site1, systems from site2, systems from site3, etc.
##Singapore
$global:mySinStorage1 = "system1_1"
$global:mySinStorage = "system1_2"
$global:AllSin = $global:mySinStorage1,$global:mySinStorage
##Budapest
$global:myBudStorage = "system2_1"
$global:myBudStorage = "system2_2"
$global:AllBud = $global:myBudStorage1,$global:myStorage2
Calling $global:AllBud or $global:AllSin works without issue, however when trying to build a grouping for easier updating, I am missing something(probably simple.
##All EMEA
$global:myEMEAStorage = {$global:AllBud,$global:AllSin}
This seems to create a variable with two strings made of each original variable, which as I understand is to be expected.  Is there an easy way to rebuild this variable with each entry as a separate entity so processing and parsing can read them?  
Currently I have these larger entries with each system specified, this has lead to variables with 120+ hand entered entries.  Needless to say this very easily has lead to misses/errors.
Thank you for any help,
Scott

Here is how to use variables in PowerShell or any other obect system.
$cityhash=@{
City=''
Storage1=$null
Storage2=$null
$cities=@()
##Singapore
$cityhash.City='Singapore'
$cityhash.Storage1 = "system1_1"
$cityhash.Storage2 = "system1_2"
$cities+=[pscustomobject]$cityhash
##Budapest
$cityhash.City='Budapest'
$cityhash.Storage1 = "system1_1"
$cityhash.Storage2 = "system1_2"
$cities+=[pscustomobject]$cityhash
# get a city
$p=$cities | ?{$_.City -eq 'Budapest'}
$p.Storage1
¯\_(ツ)_/¯

Similar Messages

  • Nested variables in cfquery

    Hi,
    I have a query which is called "myQuery" and I want to have the value of a field in myQuery like below:
    myValue= #myQuery.FirstName#
    But the name of the field is in another variable: #myfield#. So, I want :
    myValue= #myQuery.#myfield##
    But this statement cause an error as it has nested variables.
    Could any body help me to solve my problem?

    It's mentioned - in passing - here.
    There's no mention of this, or cross reference to this, or any suggestion it's relevant at all on the <cfquery> page, which is... oh, I dunno... it's predictable of livedocs, really.
    Adam

  • Non-static variable Help needed

    Hi, I am creating a multi threaded web server but get the following error
    non-static variable this cannot be referenced from a static context
    HttpRequest request = new HttpRequest(connectionSocket);
    Please could someone help.
    Many Thanks
    import java.io.* ;
    import java.net.* ;
    import java.util.* ;
    public final class MultiWebServer
    public static void main(String argv[]) throws Exception
         // Set the port number.
         int port = 6789;
    // Establish the listen socket.
                   String fileName;
                   ServerSocket listenSocket = new ServerSocket(port);
    // Process HTTP service requests in an infinite loop.
    while (true) {
         // Listen for a TCP connection request.
         Socket connectionSocket = listenSocket.accept();
    // Construct an object to process the HTTP request message.
    HttpRequest request = new HttpRequest(connectionSocket);
    // Create a new thread to process the request.
    Thread thread = new Thread(request);
    // Start the thread.
    thread.start();
    final class HttpRequest implements Runnable
         final static String CRLF = "\r\n";
         Socket socket;
    String requestMessageLine;
    String fileName;
    Date todaysDate;
         // Constructor
         public HttpRequest(Socket socket) throws Exception
              this.socket = socket;
              socket = null;
    // Implement the run() method of the Runnable interface.
    public void run()
         try {
              processRequest();
         } catch (Exception e) {
              System.out.println(e);
    private void processRequest() throws Exception
         // Get a reference to the socket's input and output streams.
         //InputStream is = new InputStream(socket.getInputStream());
         //DataOutputStream os = new DataOutputStream(socket.getOutputStream());
    BufferedReader inFromClient =
                        new BufferedReader(new InputStreamReader(
                             socket.getInputStream()));
                   DataOutputStream outToClient =
                        new DataOutputStream(
                             socket.getOutputStream());
         // Set up input stream filters.
         requestMessageLine = inFromClient.readLine();
         //BufferedReader br = null;
         // Get the request line of the HTTP request message.
    String requestLine = null;
    // Display the request line.
    System.out.println();
    System.out.println(requestLine);
    StringTokenizer tokenizedLine =
                             new StringTokenizer(requestMessageLine);
                   if (tokenizedLine.nextToken().equals("GET"))
                        fileName = tokenizedLine.nextToken();
                        if ( fileName.startsWith("/")==true )
                             fileName = fileName.substring(1);
    File file = new File(fileName);
                        int numOfBytes = (int)file.length();
                        FileInputStream inFile = new FileInputStream(fileName);
                        byte[] fileInBytes = new byte[numOfBytes];
                        inFile.read(fileInBytes);
                        /* Send the HTTP header */
                        outToClient.writeBytes("HTTP/1.1 200 Document Follows\r\n");
                        if (fileName.endsWith(".jpg"))
                             outToClient.writeBytes("Content-Type: image/jpeg\r\n");
                        if (fileName.endsWith(".jpeg"))
                             outToClient.writeBytes("Content-Type: image/jpeg\r\n");
                        if (fileName.endsWith(".gif"))
                             outToClient.writeBytes("Content-Type: image/gif\r\n");
                        if (fileName.endsWith(".html"))
                             outToClient.writeBytes("Content-Type: text/html\r\n");
                        if (fileName.endsWith(".htm"))
                             outToClient.writeBytes("Content-Type: text/html\r\n");
                        outToClient.writeBytes("Content-Length: " + numOfBytes + "\r\n");
                        outToClient.writeBytes("\r\n");
                        /* Now send the actual data */
                        outToClient.write(fileInBytes, 0, numOfBytes);
                        socket.close();
                   else
                   System.out.println("Bad Request Message");
                   todaysDate = new Date();          
                   try {
                        FileInputStream inlog = new FileInputStream("log.txt");
                        System.out.println(requestMessageLine + " " + todaysDate );
                        FileOutputStream log = new FileOutputStream("log.txt", true);
                        PrintStream myOutput = new PrintStream(log);
                        myOutput.println("FILE -> " + requestMessageLine + " DATE/TIME -> " + todaysDate);
                   catch (IOException e) {
                   System.out.println("Error -> " + e);
                   System.exit(1);
    socket.close();

    import java.io.* ;
    import java.net.* ;
    import java.util.* ;
    public final class MultiWebServer
    public MultiWebServer(){
    try{
    // Set the port number.
    int port=6789;
    // Establish the listen socket.
    String fileName;
    ServerSocket listenSocket=new ServerSocket(port);
    // Process HTTP service requests in an infinite loop.
    while(true){
    // Listen for a TCP connection request.
    Socket connectionSocket=listenSocket.accept();
    // Construct an object to process the HTTP request message.
    HttpRequest request=new HttpRequest(connectionSocket);
    // Create a new thread to process the request.
    Thread thread=new Thread(request);
    // Start the thread.
    thread.start();
    }catch(IOException ioe){
    }catch(Exception e){
    public static void main(String argv[]) throws Exception
    new MultiWebServer();
    final class HttpRequest implements Runnable
    final static String CRLF = "\r\n";
    Socket socket;
    String requestMessageLine;
    String fileName;
    Date todaysDate;
    // Constructor
    public HttpRequest(Socket socket) throws Exception
    this.socket = socket;
    socket = null;
    // Implement the run() method of the Runnable interface.
    public void run()
    try {
    processRequest();
    } catch (Exception e) {
    System.out.println(e);
    private void processRequest() throws Exception
    // Get a reference to the socket's input and output streams.
    //InputStream is = new InputStream(socket.getInputStream());
    //DataOutputStream os = new DataOutputStream(socket.getOutputStream());
    BufferedReader inFromClient =
    new BufferedReader(new InputStreamReader(
    socket.getInputStream()));
    DataOutputStream outToClient =
    new DataOutputStream(
    socket.getOutputStream());
    // Set up input stream filters.
    requestMessageLine = inFromClient.readLine();
    //BufferedReader br = null;
    // Get the request line of the HTTP request message.
    String requestLine = null;
    // Display the request line.
    System.out.println();
    System.out.println(requestLine);
    StringTokenizer tokenizedLine =
    new StringTokenizer(requestMessageLine);
    if (tokenizedLine.nextToken().equals("GET"))
    fileName = tokenizedLine.nextToken();
    if ( fileName.startsWith("/")==true )
    fileName = fileName.substring(1);
    File file = new File(fileName);
    int numOfBytes = (int)file.length();
    FileInputStream inFile = new FileInputStream(fileName);
    byte[] fileInBytes = new byte[numOfBytes];
    inFile.read(fileInBytes);
    /* Send the HTTP header */
    outToClient.writeBytes("HTTP/1.1 200 Document Follows\r\n");
    if (fileName.endsWith(".jpg"))
    outToClient.writeBytes("Content-Type: image/jpeg\r\n");
    if (fileName.endsWith(".jpeg"))
    outToClient.writeBytes("Content-Type: image/jpeg\r\n");
    if (fileName.endsWith(".gif"))
    outToClient.writeBytes("Content-Type: image/gif\r\n");
    if (fileName.endsWith(".html"))
    outToClient.writeBytes("Content-Type: text/html\r\n");
    if (fileName.endsWith(".htm"))
    outToClient.writeBytes("Content-Type: text/html\r\n");
    outToClient.writeBytes("Content-Length: " + numOfBytes + "\r\n");
    outToClient.writeBytes("\r\n");
    /* Now send the actual data */
    outToClient.write(fileInBytes, 0, numOfBytes);
    socket.close();
    else
    System.out.println("Bad Request Message");
    todaysDate = new Date();
    try {
    FileInputStream inlog = new FileInputStream("log.txt");
    System.out.println(requestMessageLine + " " + todaysDate );
    FileOutputStream log = new FileOutputStream("log.txt", true);
    PrintStream myOutput = new PrintStream(log);
    myOutput.println("FILE -> " + requestMessageLine + " DATE/TIME -> " + todaysDate);
    catch (IOException e) {
    System.out.println("Error -> " + e);
    System.exit(1);
    socket.close();

  • Inserting content in a Variable [HELP!]

    Hello all,
    I'm creating a business process using OBPM and my situation is:
    I have a web service that returns a XML file in string format. After this web service I have another one that receives a complex type sequence.
    Between these two services I put a Java Embedding to convert the XML string to a XML Document, and then I must add this XML document as a child of my another web service input.
    Being, more clear.
    My web service A returns this:
    <getArrPersonReturn type="ns2:Vector">
         <item type="ns2:Person">
              <age type="xsd:int">23</idade>
              <name type="soapenc:string">Alan</nome>
         </item>
         <item type="ns2:Person">
              <age type="xsd:int">20</idade>
              <name type="soapenc:string">Charles</nome>
         </item>
    </getArrPessoaReturn>
    As I told, this is all XML String, and not XML Document.
    My next web service receives a sequence of Person. So, I am trying to convert those XML string to a XML Document and insert each <item> in the input variable to the next web service. To achieve this, I tryed:
    1. Got the next web service input as an Element:
    Element element_varTest = (Element)getVariableData("TestWS","v","/v");
    When I give a System.out.println(element_varTest), I get:
    <v xmlns:def="urn:WSPerson" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="def:Vector"></v>
    2. So I try to give a element_varTest.appendChild(each_above_item) to put those itens inside <v></v>, but it doesn't work. Always I receive an error saying only NULL. :'-(
    If anyone could help me I would appreciate so much!!!!
    Thanks a lot,
    Fabricio.

    As it is defined as a string, it will not be recognized as an XML document. So, the first step you need to take, is to convert the string to an XML doc. The easiest way to do so, is to use parseEscapedXML, like:
    <assign name="copyXMLstring">
    <copy>
    <from expression="ora:parseEscapedXML(bpws:getVariableData('input'))"/>
    <to variable="output" query="/ns1:return"/>
    </copy>
    </assign>
    where the structure is defined in ns1. After this, you can handle 'output' as an XML document.

  • Creating materialized view with variables - help

    Greetings,
    I want to create an materialized view (MV) from the external public db link. Below is my full query:
    CREATE MATERIALIZED VIEW PROJECTS_MV
    REFRESH WITH ROWID
    AS
    SELECT prj.Project_id, prj.desc,
    prj.parent_project_id, f_year, f_month
    FROM sysadm.prj@EFUYEEDW_DB_LINK.MSDB prj
    WHERE prj.pf_scenario_id = '708KDD'
    AND prj.ph_id = 'SHAREDP'
    AND f_year = (SELECT EXTRACT(year FROM current_DATE) FROM dual)
    AND f_month = (SELECT EXTRACT(month FROM current_DATE) FROM dual)
    Question: In the query there are two variables that capture the month and year and requery it. Does the data get updated automatically when a new month or new year changes?
    If there is a change, how would I change so it would update the data accordingly?
    Thanks for your help
    john9569

    Hi Christian,
    Thanks for your response. Your codes return the date as 01-JAN-09 which is not what I'm looking for. Maybe my question is not clear.
    So far, the MV is executed correctly what I want. My concern is when it updates the MV, does it get the new data (f_month & f_year) when the MV is updated automatically?
    Other words, the MV is updated nightly to get the incremental data from the db link. Once it passes to the new month, I am not sure how this MV handles since the f_month is now changed to differrent number.
    Thanks for your help.
    Bests,
    John9569

  • Defining a variable help

    What's it mean when variables are defined with boolean operators? I've seen it before but can't find any help on it in the Java Tutorial so I don't really know what it means.
    e.g.
    int var1 = (var2 & var3) | var4

    Bitwise and Bit Shift Operators
    [http://java.sun.com/docs/books/tutorial/java/nutsandbolts/op3.html|http://java.sun.com/docs/books/tutorial/java/nutsandbolts/op3.html]

  • Shared Variable Help

    Hey,
    I need some help with shared variables. Here is what I'm trying to do. I run a vi on the computer that uses a camera to track certain objects. I would like this program to send the position of the object to another vi that is running at the same time on the speedy-33. The speedy-33 takes the position and rotates the robot towards the object. The problem I have is communicating the position from the computer to the speedy-33.
    From what I've read, I think I'm supposed to do this with shared variables. On the computer target,  I created a library with an integer variable (to hold the x position of the object). I set this variable in the computer vi using the shared variable. All of this is in a while loop. On the speedy-33 VI, I've connected a control to the shared variable. When I run the program everything works as intended so far. When the object's x value changes the control on the speedy-33 front panel changes appropriately. However, when I try to drag the variable onto the speedy-33's block diagram from the project explorer I get a bunch of errors. The first is "My Computer\Variables.lvlib\xpos: Not supported for current target." Since it appears this isn't supported for the speedy-33 how am I supposed to transfer the data?
    Hope all that makes sense.
    Thanks

    Squirell wrote:
    Hope all that makes sense.
    Well, I for one got lost somewhere in there. Didn't you say that you already had the shared variable in both the computer VI and the Speedy-33?
    It may be a good idea to take a look at the Shared Variable Client-Server example, and perhaps test it to see if it, at least, can work on your setup.
    I for one gave up on shared variables (flow control was just too much trouble) and am using "functional globals" instead. http://zone.ni.com/devzone/cda/epd/p/id/4364 was particularly helpful.Message Edited by kehander on 02-20-2007 12:46 PM

  • Settings in Variables help input (F4) in Web

    NetWeaver 7.0 -> Stack 13
    Hi,
    When you select a value in a Query with the help input (F4), you have a settings menu to select the display (key, text, key and text...) or add some attributes in your value list.
    These settings are available in:
    - BEX analyser in the variable screen (before query execution)
    - BEX analyser in the select filter value (after query execution)
    - Web portal in the select filter value (after query execution)
    But not available in:
    - Web portal in the variable screen (before query execution).
    You know why ? Have I missing a parameter in the WAD ? Is it planned in next Support package ?
    Thanks you for your help.
    Nicolas

    Did you ever figure this out? We are having the same problem...

  • Query Variable Help

    Dear Gurus, I was looking for a variable for Fiscal Year/Period in Busines content that can be a single entry, mandatory. I found one 0S_FPER. In the report, when I restrict Fiscal Year/Period with this variable, I wanted to select the 'offset' to -1 but it is disabled. How can get it enabled?

    Vijay,
    Thanks for the help. Now I understand these variable stuff little better.
    I still have one problem. I cannot use the offset -1 for 2 columns. It gives mw "Program termination" error when I try to save it with 2 column having offset of -1 on the same variable.
    Does anybody know how to solve this peoblem.

  • Using Decode to initialize variables.Help please

    I need to initialize a variable to a value of Y or N
    depending upon the argument passed in the function.
    If the argument has the value 'Y',the variable in
    the function is set to Y else it is set to N.
    For this,I'd like to use the DECODE statment.
    Can anyone please help me please?
    CREATE OR REPLACE FUNCTION generate_type(
            a_cmpy_num              NUMBER,
            a_boolean               VARCHAR2
    RETURN VARCHAR2
    AS
       v_boolean              VARCHAR2(1) := Could be Y or N depending upon
                                             argument a_boolean?
                                             How to use the DECODE function here?
    BEGIN
    END;Invoke the function by
    generate_type(1,'Y');

    Because he only wants Y if it is Y and he wants N if it anything else, like G.
    So he would do something like
    v_boolean varchar2(1) := 'N';
    begin
      if a_boolean := 'Y' then
        v_boolean := 'Y';
      end if;

  • Nested data help

    Hello all,
      I have two internal tables for PO line items: 1) POitems that contains data like POdoc number, POline number, MATNR, MATDESC, QTTY, AMOUNT Etc. 2) POTexts that contains PO Texts.
    I want to print the data in the form in this format:
    Matnr | Description | QTTY| Amount|   on the first line and then the PO texts for that line item from the next line onwards.
    The PO Texts can be any number of lines depending on what user put in the PO for that line item.
    I tried to nest the tables but I get all the line items printed first and then the PO texts. For example, if I have 5 line items in the PO. The data Matnr | Description | QTTY| Amount|  for all five items is first printed and then the PO texts for all these five line items are printed. I just can't get this to work. Any help is appreciated.
    Thanks.

    The issue is resolved. In the context tab, for the PO text tableI had not put the where conditions for EBELN = IT_EKPO-EBELN and EBELP = IT_EKPO-EBELP. Works perfect now.

  • Webi Error (WIS 10012) when trying to create a variable help me

    Hi ,
    I am struck with an error in webi When i trying to create a tax variable i have given the formula as [Sales Revenue]* 0.175 and trying to save it i am getting the below error
    " the Number .175 at position 15 has a format that is incompatible with your regional settings,(WIS 10012)"
    when i try in different way [Sales Revenue]* (0,175) i am getting right answer. Please help me where i have to change my regional settings.

    Hi Sreeram,
    What is the Locale set at the universe level inside Tools --> Options --> General tab? Can you share the screenshot?
    The drop down option at left bottom side helps you to set the language for the GUI; however, the button next to it decides the locale of the data.
    You need to set the same locale at Webi level as well. If your value is a decimal value then setting locale to English US might not help as comma (,) is used for digit grouping and dot (.) is used as a decimal seperator; whereas, the value shown by has comma as decimal seperator.
    The locale settings of European countries (like French, Dutch, German, etc.) have the opposite format i.e. dot is used for digit grouping and comma is used for decimal seperation.
    I am pretty sure any of such locales are set at universe level. Check and have same locale in Webi Preferences.
    Hope it will help.
    Regards,
    Yuvraj

  • Illustrator Data Sets and Variables Help Please

    Hi, how's everyone doing?  I need a little help with Data Sets and Variables, or at least i believe that's what i need help with.  Ultimately i am trying to run an action on a batch of files. 
    I have an eps file with two images placed side by side.  They are the same image.  I am trying to replace both images and save the file accordingly.  Trying to make this happen using a bunch of files.  All the files can be in one folder and will be the same size. 
    I hope this make sense and what i need done is doable.
    Any help or advise would be greatly appreciated.
    Thanks in advance.

    Not sure a I read you correctly but if I understand you
    what you have to do is make the first two images as dynamic variables using the variable panel and save it as a data set
    then replace those two images and save those as a data set
    So now you have data set one and two.
    You can save that as an variable library (xml)and that can be loaded into other documents.
    The question is can it be actioned?
    It can be scripted and do you want the same two images to replace the same two image in each document.
    I think you really have to tell us more.

  • Nested Loop Help

    Hello,
    I have generated a simple VI, to make multiplication and division operations. I have the following operation performed with the following inputs.
    A1 has a value range from 1 -10 fixed
    A2 has an input range of 1 - 5
    A3,A4 are constants.
    so Result  = (A1*A3 ) / (A4*A2)*100 ,
    I want to  plot "Result Vs. A1" with a current value of A2, increment A2 and repeat the procedure. So I generate 5 graphs and display it in only one. I need to write a nested loop to perform this operation.however I am able to do it only once.
    I am trying to use for loop structure in one another but havent gone ahead in this.Any help will be appreciable..Thanks in advance.

    altenbach wrote:
    Dravi99 wrote:
    The Problem is that I want to plot the division result vs. the # of array out elements and i am unsuccessful at it. May be i am missing on the waveform graph properties.
    You should make the current values default before saving so we have some typical data to play with.
    Currently, your code makes very little sense, because the inner loop has no purpose.
    If you plot the division result versus array index (I assume that's what you want, I don't understand what you mean by "the # of array out elements "), you only have one plot. What should be on the other plots???
    Please explain or even attach an image of the desired output. Thanks!
    Thanks Altenbach for the inputs.
    I have made the values default. Srry for the previous one.
    Now the inner loop was placed so that i can create a 2D array.
    I need to plot the division result vs. the value of the element in the arry out. i.e. currently my array out has 0.0...,0.3 I want that to be the X axis.
     The graph plotted   is for 1st value of "in", this value will change like from 4.5 to 4.7 to 4.9, not necesarily in steps.
    Thus my one graph should have multiple plots of "in" which has the above mentioned axis.
    Hope this time i was clear in my msg. I have attached the modified VI.
    Attachments:
    For_loop_prob.vi ‏17 KB

  • Object variable help - Note 1131320

    Good Morning experts!
    I've had a situation where an install was done and when modifying an application in the admin console, we get an error with object variable or object not set.  While searching the notes, I found note 1131320 that states that you should replace the admin templates under webfolders.
    I did that.  However, there's a step that it asks you to do that I'm not very familiar with.  Step 5 states to publish all reports.  Anyone know how to do that off the top of their head?  I could figure it out over the weekend, but we have some deliverables that are being held up!
    Your help is greatly appreciated!
    Barton

    The note you reference was posted for updgrades from versions 5.X to 5.1 SP1 and I wondered if you had upgraded to version SP3 instead of 1.  The process that the team suggests should have included the following:
    You have to go through the Web Admin interface to Publish All Reports.
    1. Enter the BPC Admin Web interface
    2. Under Web Admin Task Click Publish Reports
    3. Select all of the reports and click the green check mark to publish the reports.
    This then pushes the new templates for use in the web interface. Hope this helps.
    Edited by: Petar Daniel on Oct 6, 2008 10:50 PM

Maybe you are looking for

  • Uninstalling obiee 11g (11.1.1.3)

    Hi, Can any one tell me about uninstalling OBIEE 11g (11.1.1.3). Unfortunately I am unable to find Deinstall or Uninstall option in Start-->Programs-->Oracle Business Intelligence. How can I uninstall it from command prompt or where can I get the dei

  • Merge data and flaten a PDF form.

    I am working for the first time on using ColdFusion to populate PDF forms. I have a simple PDF form I created with my Acrobat 9 Pro tool.  Using the following code, pretty much straight from the documentation, I can easily populate the fields in the

  • On Equium A100-337 WLAN connection security screen is not displayed correctly

    My computer use to connect to a specific wireless network without any problems automatically. However, now when trying to connect to the same network, the security key screen I am presented with is not the correct type. Instead of two lines of encryp

  • Toast with a Blu-ray external writer?

    Hello everybody! I am very frustrated because I just got the Samsung writer for Mac and Windows...and is not compatible with Mac...so a waste of money, and now I need to buy a real Blu-ray DVD burner for Mac... I see a lot of people using Toaster...m

  • Cross cables not supported

    hi all, i had read in lots of documents cross cable is not supported for RAC environment. My Environment is as follows: OS : SUN SPARC SOLARIS 5.10 RDBMS : ORACLE 10.2.0 RAC NODES : 2 SERVERS : V490 STORAGE : 3100 SWITCH : SAN OS is installed on 2 no