Passing a parameter to an 'Expect' script

Hi,
Does anyone know how to pass a parameter from a regular Linux shell script to an expect script.
I'm using the standard $1 but the expect script gives me an error.
How does Expect want us to pass parameters to it?
My call to the script and the script are below.
expect -f /home/fhs_clientdata/ftpget/fhs_ftpput_exehfc_expect.sh $FILE_NAME_SOURCEthe Expect script:
spawn sftp [email protected]
set PASSWORD "AbCd46%Z"
expect "password:"
send "$PASSWORD\n"
expect "sftp>" {
          send "cd inbound\n"
          expect "sftp>"
          send "put $1\n"
          expect "sftp>"
          send "bye\n"
          send_user "Done\n"
          exit
       } "Permission denied, please try again." {
          send_user "There was error with th permissions"
          exit
       }

You may need to read the input parameters first, e.g.:
set file [lindex $argv 0]
Then: send "put $file\r"
There is a good example at http://en.wikipedia.org/wiki/Expect

Similar Messages

  • Passing  Time Parameter to a SQL Script

    I am trying to create an SSIS package that will extract data from a non BPC database  to load into BPC. I am calling the package from DM prompting for the time parameter.  However,   I am having problems passing the parameter to the SQL script.  I am using OLEDB Data source task using the SQL command - Using the following scrip where the '?'' is the prompt for the BPC time parameter.  Any suggestions on how to resolve would be greatly appreciated.
    SELECT
             CASE
                      WHEN LEN(GLAccountNumber)=10
                      THEN LEFT(GLAccountNumber,6)
                      ELSE GLAccountNumber
             END                                                   AS ACCOUNT     ,
             'F_CLO'                                               AS ACCTDETAIL  ,
             'ACTUAL'                                              AS CATEGORY    ,
             RTRIM(CompanyCode)                             AS COMPANY     ,
             RTRIM(CompanyDepartment)                              AS COSTCENTER  ,
             'FM'                                                  AS DATASRC     ,
             'NON_INTERCO'                                         AS INTERCO     ,
             'NOMAT'                                               AS MATERIALS   ,
             'NOPC'                                                AS PROFITCTR   ,
             'LC'                                                  AS RPTCURRENCY ,
             CAST(YearNumber AS CHAR(4)) + '.' + MonthAbbreviation AS [TIME]      ,
             SUM(TransactionAmount)                                AS SIGNEDDAA
    FROM     dbo.GLTransactionDimension a WITH (nolock)
             JOIN dbo.GLTransactionFacts b WITH (nolock)
             ON       a.GLTransactionDimensionKey = b.GLTransactionDimensionKey
             JOIN dbo.DateDimension c WITH (nolock)
             ON       b.EntryDateDimensionKey = c.DateDimensionKey
    WHERE    EntryDateDimensionKey         LIKE
              CASE
                      WHEN RIGHT(?,3)='APR' THEN '200904%'
                      WHEN RIGHT(?,3)='MAY' THEN '200905%'
               END
             AND      RowType = 'T'
    GROUP BY CompanyCode ,
             DepartmentCode     ,
             CompanyDepartment  ,
             GLAccountNumber    ,
             YearNumber         ,
             MonthAbbreviation
    ORDER BY CompanyCode ,
             DepartmentCode     ,
             GLAccountNumber    ,
             YearNumber         ,
             MonthAbbreviation

    Hi Steven,
    Use SQL task without parameter
    Into DM package into Modify script Build a variable where you will build the entire sql string and of course you will be able to pass also the variable.
    After that you will call into Modify scrip something like:
    TASK( Yourtask, SQL, "the entire SQL with parameter")
    Regards
    Sorin

  • Passing a parameter to a shell script through concurrent program

    Hi All,
    I am trying to pass a runtime parameter from oracle application to a shell script which inturn calls a sql script. The parameter iam passing has a space for example. iam passing something like "Customer 1" so how does the shell script interpret this parameter. Any ideas are appreciated.
    Thanks,

    You may need to read the input parameters first, e.g.:
    set file [lindex $argv 0]
    Then: send "put $file\r"
    There is a good example at http://en.wikipedia.org/wiki/Expect

  • Passing concurrent parameter to OS script

    I have a printer driver that calls an OS script and I want to pass a parameter value to that script from a concurrent program that uses that driver via a specific style.
    Is there anyway to reference the concurrent parameter? I'm already passing the filename to the script via $PROFILES$.FILENAME. Is there a similar reference to a parameter value that I could use?
    Any help would be much appreciated.
    Thanks,
    Todd

    Hi Todd
    I thinh this will only get the concurrent request id what he wants is to send the send the parameter to it.. Will it work.. I am not sure.. Just put my views thats all..
    Sunil

  • How to pass a parameter into RMAN script

    Hello,
    I have the following rman script :
    run {
    CONFIGURE RETENTION POLICY TO REDUNDANCY 1;
    CONFIGURE CONTROLFILE AUTOBACKUP OFF;
    CONFIGURE DEVICE TYPE DISK PARALLELISM 2;
    CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT 'c:\oracle\RmanORCL102\ora_df%t_s%s_s%p';
    This script called configure.rman is launch by a .bat script with the following command:
    rman target 'sys/sys12@ORCL102 as sysdba' @c:\oracle\RmanORCL102\configure.rman
    How can I pass a parameter into rman script, I want to pass an additional directory like this:
    rman target 'sys/sys12@ORCL102 as sysdba' @c:\oracle\RmanORCL102\configure.rman v_dir_name
    And use it in rman script:
    CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT 'c:\oracle\RmanORCL102\$v_dir_name\ora_df%t_s%s_s%p';
    Is it a way to do this?
    Regards,
    Elodie

    One option would be to create a file called backup.bat with the following:
    echo run {
    echo CONFIGURE RETENTION POLICY TO REDUNDANCY 1;
    echo CONFIGURE CONTROLFILE AUTOBACKUP OFF;
    echo CONFIGURE DEVICE TYPE DISK PARALLELISM 2;
    echo CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT 'c:\oracle\RmanORCL102\%1\ora_df%t_s%s_s%p';
    echo } ) | rman target sys/sys12@orcl102and then call the script as:
    c:\> backup.bat backup_directory_name

  • How pass a parameter with forward slash to plsql script

    Hi,
    I am trying pass a parameter to plsql script from command line using sqlplus, and the parameter is a file directory and has '/'. Seems the system couldn't recognize the value.
    here is my code in DECLARE:
    l_FileDir VARCHAR2(200) := &&FileDir ;
    I pass value '/usr/tmp' (with the single quote in the string)
    Can someone tell me how I do it?
    Thanks,
    Kate
    Edited by: user12100435 on Feb 25, 2010 8:31 AM

    user12100435 wrote:
    I think you are right. The issue is not file-separator character issue. because the exact same script run in another envoironment. And it's not file directory or permission issue because if I use hardcoded value, the code works fine.
    The error message is invalid File directory.
    Here is the related part of the code.
    -- open file handler
    IF UTL_FILE.IS_OPEN(l_FileHandler) THEN
    UTL_FILE.FCLOSE(l_FileHandler);
    ELSE
    l_FileHandler := UTL_FILE.FOPEN ( location => l_FileDir,
    filename => l_FileName,
    open_mode => 'W',
    max_linesize => 32767 );
    END IF;Ok, based on your input so far, I have cooked up a simple testcase.
    Make sure you are doing something similar to this -
    test@XE>
    test@XE> -- show the contents of the anonymous PL/SQL script
    test@XE> -- You are probably passing two parameters - the file location and the file name
    test@XE> --
    test@XE> ! cat test5.sql
    DECLARE
      l_FileHandler UTL_FILE.FILE_TYPE;
      l_FileDir     VARCHAR2(200) := '&1' ; 
      l_FileName    VARCHAR2(200) := '&2' ; 
    BEGIN
      -- open file handler
      IF UTL_FILE.IS_OPEN(l_FileHandler) THEN
        UTL_FILE.FCLOSE(l_FileHandler);
      ELSE
        l_FileHandler := UTL_FILE.FOPEN ( location => l_FileDir,
                                          filename => l_FileName,
                                          open_mode => 'W',
                                          max_linesize => 32767 );
        UTL_FILE.PUT_LINE(file => l_FileHandler, buffer => 'Hello, World!');
        UTL_FILE.FCLOSE(file => l_FileHandler);
      END IF;
    END;
    test@XE>
    test@XE> -- execute it
    test@XE> @test5.sql '/usr/tmp' 'first.txt'
    old   3:   l_FileDir     VARCHAR2(200) := '&1' ;
    new   3:   l_FileDir     VARCHAR2(200) := '/usr/tmp' ;
    old   4:   l_FileName    VARCHAR2(200) := '&2' ;
    new   4:   l_FileName    VARCHAR2(200) := 'first.txt' ;
    DECLARE
    ERROR at line 1:
    ORA-29280: invalid directory path
    ORA-06512: at "SYS.UTL_FILE", line 33
    ORA-06512: at "SYS.UTL_FILE", line 436
    ORA-06512: at line 10
    test@XE>
    test@XE> -- Create a directory object that points to "/usr/tmp"
    test@XE> create directory log_dir as '/usr/tmp';
    Directory created.
    test@XE>
    test@XE> -- now invoke the script
    test@XE> -- Note - I pass the value "LOG_DIR" in uppercase. That's the name of my directory object.
    test@XE> --
    test@XE> @test5.sql 'LOG_DIR' 'first.txt'
    old   3:   l_FileDir     VARCHAR2(200) := '&1' ;
    new   3:   l_FileDir     VARCHAR2(200) := 'LOG_DIR' ;
    old   4:   l_FileName    VARCHAR2(200) := '&2' ;
    new   4:   l_FileName    VARCHAR2(200) := 'first.txt' ;
    PL/SQL procedure successfully completed.
    test@XE>
    test@XE> -- Since my Oracle client is on the same machine as the Oracle server, I can check
    test@XE> -- this file "/usr/tmp/first.txt" quite easily
    test@XE>
    test@XE> ! cat /usr/tmp/first.txt
    Hello, World!
    test@XE>
    test@XE> isotope

  • How do I Pass a parameter to a SQL Component Task where the source SQL statement is also a variable

    Hi,
    I have been tasked with making a complex package more generic.
    To achieve this I need to pass a parameter to a SQL Component Task where the source SQL statement is also a variable.
    So to help articulate my question further I have create a package and database as follows; -
    USE [KWPlay]
    GO
    /****** Object: Table [dbo].[tblTest] Script Date: 05/14/2014 17:08:02 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE TABLE [dbo].[tblTest](
    [ID] [bigint] IDENTITY(1,1) NOT NULL,
    [Description] [nvarchar](50) NULL,
    CONSTRAINT [PK_tblTest] PRIMARY KEY CLUSTERED
    [ID] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY]
    GO
    I populated this table with a single record.
    I unit tested the SQL within SSMS as follows;
    SELECT * FROM dbo.tblTest
    Result; -
    ID           
    Description
    1             
    Happy
    DECLARE @myParam NVARCHAR(100)
    SET @myParam = 'Sad'
    UPDATE dbo.tblTest SET [Description] = @myParam FROM dbo.tblTest WHERE ID = 1
    SELECT * FROM dbo.tblTest
    Result; -
    ID   
    Description
    1    
    Sad
    Within the package I created two variables as follows; -
    Name: strSQL
    Scope: Package
    Data Type: String
    Value: UPDATE dbo.tblTest SET [Description] = @myParam FROM dbo.tblTest WHERE ID = 1
    Name: strStatus
    Scope: Package
    Data Type: String
    Value: Happy
    I then created a single ‘Execute SQL Task’ component within the control flow as follows; -
    However when I run the above package I get the following error; -
    SSIS package "Package.dtsx" starting.
    Error: 0xC002F210 at Execute SQL Task, Execute SQL Task: Executing the query "UPDATE dbo.tblTest SET [Description] = @myParam FR..." failed with the following error:
    "Parameter name is unrecognized.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
    Task failed: Execute SQL Task
    Warning: 0x80019002 at Package: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED. 
    The Execution method succeeded, but the number of errors raised (1) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the
    errors.
    SSIS package "Package.dtsx" finished: Failure.
    I also tried; - 
    Name: strSQL
    Scope: Package
    Data Type: String
    Value: UPDATE dbo.tblTest SET [Description] = ? FROM dbo.tblTest WHERE ID = 1
    However I received the error; - 
    SSIS package "Package.dtsx" starting.
    Error: 0xC002F210 at Execute SQL Task, Execute SQL Task: Executing the query "UPDATE dbo.tblTest SET [Description] = ? FROM dbo...." failed with the following error: "Parameter name is unrecognized.". Possible failure reasons: Problems with
    the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
    Task failed: Execute SQL Task
    Warning: 0x80019002 at Package: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED.  The Execution method succeeded, but the number of errors raised (1) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches
    the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors.
    SSIS package "Package.dtsx" finished: Failure.
    Kind Regards,
    Kieran.
    Kieran Patrick Wood http://www.innovativebusinessintelligence.com http://uk.linkedin.com/in/kieranpatrickwood http://kieranwood.wordpress.com/

    Tried; - 
    Name: strSQL
    Scope: Package
    Data Type: String
    Value: UPDATE dbo.tblTest SET [Description] = ? FROM dbo.tblTest WHERE ID = 1
    and; - 
    Result; - 
    SSIS package "Package.dtsx" starting.
    SSIS package "Package.dtsx" finished: Success.
    Therefore the answer was to put the parameter number rather than the parameter name under the parameter mapping tab-> parameter name column. 
    Kieran Patrick Wood http://www.innovativebusinessintelligence.com http://uk.linkedin.com/in/kieranpatrickwood http://kieranwood.wordpress.com/

  • Passing parameters in a shell shel script

    Hi everybody,
    I am working on a task which gets report on every remote database.
    I created a small database: ‘REPORTS_DB’ and I created 6 'sql' scripts on that database. While executing the first script, it calls the other 5 different 'sql' scripts. All these 5 sql scripts use a '@db_link' (hard coded) and gets that database's report to the database: REPORT_DB.
    It is working good. But,
    We have 42 databases and I have to get reports of all the 42 databases. Since it is not efficient to create 42 sets of sql scripts, I want to make it automated.
    I know (but I don't know HOW) I can pass a parameter (database link name) while running the first script (which calls the other 5 scripts), so that the parameter replaces the @db_link in all the 5 scripts and gets the report of the related (@db_link) database.
    Could somebody send me a sample shell script to do this task?
    OR, is there any way to do this task without using shell script ?
    (BTW, we are using korn shell on sun Solaris)
    Thanks in advance.
    - JT

    Hi everybody,
    I posted same question earlier for UNIX/shell script and rec'd one response. Thanks to Bob.
    But the requirement has been changed and now my mgr wants the same task using PL/SQL. Could somebody help me ?
    Question again....
    I am working on a task which gets report on every remote database.
    I created a small database: ‘REPORTS_DB’ and I created 6 'sql' scripts on that database. While executing the first script, it calls the other 5 different 'sql' scripts. All these 5 sql scripts use a '@db_link' (hard coded) and gets that database's report to the database: REPORT_DB.
    It is working well. But,
    We have 42 databases and I have to get reports of all the 42 databases. Since it is not efficient to create 42 sets of sql scripts, I want to make it automated.
    I know (but I don't know HOW) I can pass a parameter (database link name) while running the first script (which calls the other 5 scripts), so that the parameter replaces the @db_link in all the 5 scripts and gets the report of the related (@db_link) database.
    Could somebody tell me how to do this task using SQL and PL/SQL ?
    OR
    send me a sample PL/SQL script to do this task?
    Sorry for the inconvenience and thanks in advance.
    - JT

  • Can I pass a parameter to a mapping without using a process flow?

    I have to load data from multiple countries at different times. Rather than creating an individual mapping for each country, I want to create 1 mapping and pass the country code as a parameter to the mapping. I tried to use an input parameter in the mapping and add a custom parameter to the sqlplus_exec_template hoping the custom parameter would pass to the mapping input parameter but it's not working. No data loads.
    When I add a default value to the input parameter, the data loads but this isn't the solution I need. The value of the parameter will vary depending on the country so I can't use defaults. Since the mappings load automatically, I need the script to be able to pass the parameter in.
    I'm trying to avoid going through a process flow because that just seems like overkill for what I need to do. I just want to load all the data where country code = 'X'. Is this even possible?

    o.k. I tried everything to see which would be the best scenario.
    Zeppo - I can't use your solution because ".main", I believe, applies to an older version of OWB. We have 10g. I know in 3.1 ".main" applies because I still have mappings from that version. Doesn't apply to 10g.
    Sutirtha - I set the property for the prompt but it still didn't work.
    MccM - Yes, the premapping process works perfectly. Only thing is that I have to come up with so many different scenarios in the If then else logic. Giving me a migraine ...
    .... so ....
    I punked out and created a table that stores all of the load times by country code. In the joiner, I linked the table's country code to the country code in my view and only retrieved data where the table's load hour equals the sysdate hour. Now all I have to do is change an entry in the working table if I need to reschedule a load.
    It's cluggy but it works ... and I met me goal of only using 1 mapping.
    Thanks to all of you for providing your input. Much appreciated.

  • Pass output parameter from mapping to external process in a Process Flow

    In Process flow, how do we pass an Output parameter from a mapping (generated by a post mapping operator) into an external process (shell script)?
    I have a mapping that generates an output parameter and I would like to pass this parameter to an external process (a shell script) with a process flow. Is this possible?

    Hi Norman,
    Unfortunately in the current release, you cannot do this. What you can do, is store the value into a table and read it in the external process, or write it into a file and read it from there. The next release will support passing output parameters from one activity to the next.
    Thanks,
    Mark.

  • Pass one parameter to lov

    Hi,
    I need to pass a parameter for one lov and am trying to pass with the code:
    In the page that calls the Lov step (vinculo = 1)
    <bc4j:messageLovField
    name="CodPessoaAluno"
    attrName="CodPessoaAluno"
    columns="10"
    required="yes"
    message="Informe o Nome do Aluno"
    prompt="Codigo"
    shortDesc="Clique no botao para escolher o Nome do Aluno"
    onClick="openWindow(window,
    '../../sigep/lov/LovPessoas.uix?vinculo=1',
    'lovWindow',
    {width:700, height:525},
    true,
    'dialog',
    FunLovRetorno);
    return false;">
    </bc4j:messageLovField>
    In the event of the Lov page I try to catch vinculo.
    public static EventResult SgCreate( BajaContext bc, Page page, PageEvent event)
    int vinculo = Integer.parseInt(event.getParameter("vinculo").toString());
    String quantTrains =
    "select max(nvl(rownum,0)) quant "+
    "from           pe_vinculos                         a " +     
    "                    ,pe_vinculo_grp_inf          b " +
    "where          a.vinc_cod_vinculo          = b.vinc_cod_vinculo " +
    "and               b.vigi_sta_ativo      = 'S' " +
    "and           a.vinc_cod_vinculo           = " + vinculo + " " +
    "order by b.vigi_num_ordem " ;
    However, null arrives in vinculo. How I can catch this value?
    Fernando. parameter to lov and I try pass

    Hard to say; does the URL in the browser still contain "vinculo"? If you call PageEvent.getParameterNames(), do you see all (or any) of the parameters you expect?

  • How to define Export parameter as Import parameter in next test script.

    Hi Experts,
    We have defined Purchase order no. as export parameter in ME21N transaction test script.
    Test configuration for ME21N transaction executed succesfully and the Purchase order No. appeared in the last message
    is the export parameter for next test script i.e. MIGO transaction.
    However I am unable to define this export parameter as Import parameter in next test script for MIGO transaction.
    Please suggest me the method to define the same.
    Please Help...
    Thanks in Advance
    Vikas

    Vikas,
    You need to create super script which is nothing but having the both the steps (Po creation & MIGO ) in this eCatt script. This can be achieved by using the REF command as ex. below.
    Create PO
    REF ( Z_CREATE_PO , Z_CREATE_PO_1 ).
    Create MIGO
    REF ( Z_CREATE_MIGO , Z_CREATE_MIGO_1 ).
    Z_Create_PO is the actual eCatt script that you recorded to create the PO. Z_CREATE_QUOTE_1 is the interface created by SAP. Similarly you have use the REF command to call the MIGO script inside this super script.
    To pass the export parameter from PO step to MIGO, double click the Z_CREATE_PO_1and define the export variable for PO number. And do the same on the interface for MIGO step.
    Follow the instructions if you need in this help document posted by another user in this forum
    http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=(J2EE3417200)ID0134775250DB00634934533836311611End?blog=/pub/wlg/3497
    Note : Cut & paste the entire link above to view the document.
    thanks
    Venkat

  • Passing a parameter

    Hi all
    i need to pass as parameter a global variable (:global.id_res) from a form A to a form B
    that's what i did:
    in the form A i create a parameter:
    id_res
    in a when-button-pressed trigger i wrote:
    :parameter.id_res := :global.id_res;
    call_form'<form B path>',no_hide,no_query_only,share_library_data,:parameter.id_res);
    in the form B:
    i created a parameter id_res
    in a post-logon trigger i wrote:
    :blk_name.id_ris := :parameter.id_res;
    so i expect to have the passed parameter in :blk_name.id_ris.
    that's not. it doesn't work.
    what are the problems?
    thank you!

    As your value is already in a GLOBAL variable you don't need to do anything to pass it - just read it in the called form.
    If you want to read a global but don't know whether it exists, do a default_value(...) on it first.

  • Pass a parameter from one ASP portlet to another ASP portlet

    We are trying to pass a parameter from one ASP portlet to one or more other ASP portlets.
    We are using PDK-URL Services and have created a provider.xml for each of the ASPs and the ASPs work as normal within the portlets created.
    We are now trying to use PDK-URL Services to pass parameters to a portlet. As a first step we set up a portlet which displayed an ASP, this ASP (and the portlet) expected a parameter. If the parameter value is left blank the Portlet displays a default page (not the ASP page) for passing in the parameter i.e. a text box and a submit button. If the parameter is entered and submitted the ASP page returns and the results of the query are based on the parameter typed in.
    As the next step what we are now trying to do is pass a parameter from one ASP portlet to another.
    The Documentation says that there are two types of parameters Qualified where Parameters will be passed only to the initiating portlet i.e., portlet which contains them and Unqualified where all portlets will be affected by the parameter sent by any portlet.
    Very little information was available on this, apart from the one liner explanation of each (above).
    When we tested the above, using the PDK sample ("ParamCustomizationPortlet") portlets it doesn't appear to be doing anything in particular.
    Any ideas on the best approach to passing parameters from one ASP portlet to another?
    Thanks for your time.

    We can visualize Qualified and Unqualified parameters only when there are multiple portlet instances in a single page. For example, add two instances of ASP portlet you have created, and submit from one portlet. You can see the other portlet also receiving this parameter, provided you are using unqualified parameters.
    Thanks,
    Amjad.

  • Workflows than run a function passed as parameter

    Hello! I'm making an installation script that calls a list of functions to install each product:
    InstallSqlServer
    InstallVisualStudio "2013" "\\fileserver1\File Storage\07 Software\COMPUTER INSTALLATION\en_visual_studio_premium_2013_x86_dvd_3009258.iso"
    InstallTfs2012PowerTools
    Those are functions that contain the required code to install each product.
    The problem is that some products require a restart before trying to install them or they will fail, so... I thought of a "workflow" that reboots the system when it's required.
    That workflow should:
    Accept a function as a parameter
    Check it a reboot is required (I have a function that retrieves the information)
    Invoke the function passed as parameter (that could have parameters as well! like the InstallVisualStudio function.
    In pseudo-code it would be:
    workflow (function f)
    if RebootPending
    Reboot
    Invoke f (with its original arguments)
    Is it possible to do this?
    Thank you!
    Desde España / From Spain

    Thanks for your response.
    You say that some command line option makes it restart the machine if needed. The problem with that is that it breaks the execution of the script, and that is a major drawback. That's why I though about workspaces. I'm very new to PowerShell, sorry.
    Is there any way to surpass this problem and make the script run without breaking in the middle?
    Desde España / From Spain
    No - I said you do not need a function but you need to restart with wait.
    Restart-Computer -PSComputername $computer -wait
    This will wait on the taks until the remote system is up again.  It does not work well against a local system.
    A resume-able workflow on the local system takes more steps to save the state of the workflow so it is resume-able or you can split the workflow and schedule the remainder as a task on startup.  This is trhe easier method if you are not good with PowerShell.
    ¯\_(ツ)_/¯

Maybe you are looking for

  • IPOD Touch is an MP3 player ???

    hi, Had some various replies that iPOD touch is an iPOD mp3 player foremost. This is the reply that we get due to some basic features missing in some of the other apps. All good, no worries, as it is a mp3 player after all. Here is my question: When

  • Downloading files using HttpConnection is very slow

    Hi I've written a program which will download files over HTTP protocol using the class HttpConnection. I am connecting to the net using Proxy with authorization. At times it takes long time to download even a 2 MB file, but it works very fast on fewe

  • X-FI SPDIF = PCMStere

    <SPAN class=027469-302005>Can anyone please help me in that problem (subject above) <SPAN class=027469-302005> <SPAN class=027469-302005>I have this wonderful X-FI Platinum, and sound is (together with standard soundworks) a good gaming experience bu

  • CS4 Bridge Star sorting system doesn't work

    I have been using Photoshop and Bridge for years, but just started using Bridge in CS4 (Windows XP Pro). The sorting system where Bridge will display only those images with a specified number of stars simply does not work. I have never had this probl

  • An Interla error occured,Pl try again later while run hrrcf_start_int

    Hi . Please response asap.. I am getting following error "An internal error occurred. Please try again later" while running the for sap BSP applications for E recruiting like hrrcf_start_ext, hrrcf_start_in After reading  blogs My question is : 1.Fir