oracleforms - compile oracle form using powershell script -


I have several oracle forms in a folder and I compiled those forms through frmcmp Want to PowerHail Script

I have written a PowerShell script which is

  $ module = "module =" get-childitem "c: \ form \ lowest down" | Where {$ _ Extension - I ".fmb"} | Foreach {c: \ Oracle \ Middleware \ Oracle_FRHome1 \ bin \ frmcmp $ Module $ _ FullName userid = xyz / xyz @ xyz Output_File = C:. \ Forms \ 11 \ mango \ FMX \ $ _ basename + '. FMX '}  

but this one is not working I'm new to PowerHill

But when I try to compile a form by command prompt So his work is as follows.

  frmcmp module = c: \ forms \ src \ xyz.fmb userid = xyz / xyz @ xyz output_file = c: \ form \ 11 \ general \ fmx \ xyz.fmx  

When you want to use the variable inside the string in PowerShell, you have different options Are there. To get started, if you want the variable in your string, you will need to use " as ' to wrap the string.

$ myVariable = "MyPropertyValue" in the host "variable is $ myVariable"

will generate the above code output:

  MyPropertyValue value in the variable  

If you want to use a property of a variable (or an expression) and put it in a string, then you From $ (expression goes here) , such as

  $ MyVariable = new-object PSObject -Property @ {MyPropertyName = 'MyPropertyValue'} # Will the property be unsuccessful, only consider the variable name #, not the dot or the property name as it will be toString the object and the literal string attached. MyPropertyName Type the host "Recover the value of the failed property: $ MyVariable.MyPropertyName" . # This will be successful, because it's wrapped in the code. "Successful Property Value Recovery: $ ($ MyVariable.MyPropertyName)" # You can get any code in those rappers, for example to write mathematics host "Mathematics calculation: 3 * 27 = $ (3 * 27) " 

The above code will give the following output:

  Failed property value recovery: @ {MyPropertyName = MyPropertyValue} .MyPropertyName The value of successful asset is retrieved: MyPropertyValue Calculation of Mathematics: 3 * 27 = 81  

I usually use start-up Try / Code> CMDlet When I start process in PowerShell, because this gives me the possibility of additional control when the process starts. This means that you can use anything similar to the following.

  go- hair item "c: \ form \ foreist" -filters "* .fmb" -price | Foreach {$ FormPath = $ _FullName $ ResultingFileName = $ _ basename Start-Process -FilePath "C: \ Oracle \ MiddleWare \ Oracle_FRHome1 \ bin \ frmcmp.exe". -ArgumentList "Module = $ FormPath", "User id = xyz / Xyz @ xyz", "Output_file = C: \ form \ 11 \ common \ fmx \ $ ResultingFileName.fmx"}  

You can also add parameters for start-up commands, if you want to wait with the next item compilation until the next compilation is completed.


Comments