RIAS
asked on
Commands in Powershell
Hi,
How to run this command in PowerShell script:
cd %Pricing_Home%\builds\buildscripts
build FirstTimeDevSetup
debug build
register.bat
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi,
The error I am having is
the term 'build' is not recognised. Same for Debug, register.bat
Any suggestions? Thanks
The error I am having is
the term 'build' is not recognised. Same for Debug, register.bat
Any suggestions? Thanks
Well, where and what exactly is "build" (and "debug")?
If they're in the path, and not in the current folder, you need to remove the ".\" at the beginning.
Note that for security reasons, PowerShell will not start programs in the current directory unless they are explicitly prefixed with ".\".
And as I said before, do yourself and maybe others having to update the script the favor and add the actual extension to those files.
If they're in the path, and not in the current folder, you need to remove the ".\" at the beginning.
Note that for security reasons, PowerShell will not start programs in the current directory unless they are explicitly prefixed with ".\".
And as I said before, do yourself and maybe others having to update the script the favor and add the actual extension to those files.
ASKER
The Pricing_Home path is set like C:\abc\Dev\. Ok, thanks will try to amend it and get back.
ASKER
Got an registry error
ASKER
Error accessing the registry.
ASKER
I think it needs the admin rights. Any suggestions?
ASKER
Yes all the commands require admin
ASKER
The script I modified looks like :
Set-Location -Path "${env:Pricing_Home}builds\buildscripts"
& .\build FirstTimeDevSetup
& .\debug build
& .\register.bat
ASKER
How can I add the admin logon screen to enter admin credentials?
Thanks
Thanks
Same as before: start the PS console elevated, or use the auto-elevating script from your other questions, for example from the msixml.
Just swap the msiexec part for the build script.
Just swap the msiexec part for the build script.
ASKER
ok, thanks will do so.
Raising a new question:
Raising a new question:
ASKER
Also to answer your question
Well, where and what exactly is "build" (and "debug")?
They are .bat files in the folder: Set-Location -Path "${env:Pricing_Home}builds\buildscripts
However, it is failing. Trying to work on the syntax
Well, where and what exactly is "build" (and "debug")?
They are .bat files in the folder: Set-Location -Path "${env:Pricing_Home}builds\buildscripts
However, it is failing. Trying to work on the syntax
On closer inspection, you dropped the backslash after the closing curly brace in "${env:Pricing_Home}".
That should be
That should be
Set-Location -Path "${env:Pricing_Home}\builds\buildscripts"
ASKER
The reason was because the Pricing_Home path is set like C:\abc\Dev\
So still not sure why it is failing
So still not sure why it is failing
ASKER
We need to wait till each of .bat executes fully. Any suggestions as that can possibly be why it is failing.
Thank you once again.
Thank you once again.
ASKER
I have made seperate scripts for all three commands. Just testing it. Your earlier scripts are teaching me.
Thanks
Thanks
ASKER
All sorted now. Thanks
ASKER