mirror of
https://gitlab.com/JKANetwork/powerfulcomputermanager.git
synced 2026-03-10 12:22:03 +01:00
Changes to doc and api/app for be able to record more things
This commit is contained in:
@@ -21,37 +21,50 @@ And then, steps. First a "steps:" line, and then line by line the steps of the c
|
||||
Steps are ever put like "Type of step" | "Command"
|
||||
You can put comments in every line putting another "|" and comments at finish, like.. "CMD|WinSCP-5.13.4-Setup.exe /VERYSILENT /NORESTART|Note: Installing WinSCP"
|
||||
|
||||
Cook finishes executing if they had and error (Except in a NOERROR block), or if finishes right.
|
||||
Cook finishes executing if they had and error (Except inside a NOERROR block), or if finishes right.
|
||||
|
||||
You have examples in the example_cooks folder
|
||||
|
||||
Note: Cooks start in directory $env:temp (%TEMP%) from SYSTEM user.
|
||||
|
||||
# Type of commands
|
||||
- CMD and PWCMD: cmd command or Powershell command. Cmd commands can not work properly if has quotes (Because its run as cmd /c ""), if they are a Powershell equivalent, please use it. Normally cmd command uses are for install/uninstall exe programs or some like that, because powershell doesn't wait to exit a exe command
|
||||
- REPOTOLOCAL: Copy a file from REPO folder configured to local in temp folder to use it. You can copy files or folders with same command.
|
||||
- INSTALLMSI: Installs an MSI file silently (Params /quiet /norestart are put, do not repeat). You can add parameters (Like INSTALLMSI|superapp.msi ADDLOCAL=extension SETASDEFAULT=1)
|
||||
- NOERROR and ENDNOERROR: This is for creating a block of instructions that not captures errors, then cook works ever if instruction fails
|
||||
Example:
|
||||
NOERROR|For deleting a file that maybe can not exist
|
||||
PWCMD|Remove-Item C:\Windows\loginstall.txt
|
||||
ENDNOERROR|Finish
|
||||
- SERV_DISABLE and SERV_ENABLE: Enables or disables a Windows Service
|
||||
- MSG|Display a message to user
|
||||
- COMMENT or REM: Makes cook comments (COMMENT|This is a comment)
|
||||
- KILL_PROCESS: Kill a process name if exists
|
||||
- UNINSTALL: Uninstalls a program by name if its installed. It searchs it by Powershell command 'Get-Package -Name "Program*"', take care of it. You can use to see name
|
||||
- REMOVE: Removes a file or folder path from local computer. It's recursive
|
||||
- SLEEP and PAUSE: Pauses execution seconds specified in param
|
||||
- DOWNLOAD: This downloads a file from network/internet to $env:temp/filename. Its *required* to put a filename, that goes this way: DOWNLOAD|http://www.example.org/file.zip;filename.zip. ";" is that separates URL and filename. It seems to be a limit in PowerShell Invoke-WebRequest that limits this downloads to some like 128MB
|
||||
- EXIT: Terminates a cook in this instruction. If a param is specified, exit will be with error code and the param as text of error. (Ej: EXIT|Error at seeking for file)
|
||||
# Commands avaiable (LINUX IS NOT SUPPORTED YET)
|
||||
|
||||
| OS | COMMAND | Description |
|
||||
|----- |------------- |--------------------------------------------------------------------------------------------------------- |
|
||||
| W | CMD | Cmd command. Beware of quotes, because internally is run as cmd /c "" |
|
||||
| W/L | PWCMD | Powershell command, runs using Invoke-Command |
|
||||
| W/L | REPOTOLOCAL | Copy a file from REPO folder configured to local in temp folder. You can copy a file or a folder |
|
||||
| W | INSTALLMSI | Installs an MSI file silently (Params /quiet /norestart are put, do not repeat). You can add parameters (Like INSTALLMSI|superapp.msi ADDLOCAL=extension SETASDEFAULT=1) |
|
||||
| W/L | NOERROR | Creates a block of instructions that not captures errors and continues event if fails<br>Example:<br>NOERROR|Try to delete a file that maybe can not exist<br>PWCMD|Remove-Item C:\Windows\loginstall.txt<br>ENDNOERROR|Finish |
|
||||
| W/L | ENDNOERROR | Finishes NOERROR Block |
|
||||
| W/L | SERV_ENABLE | Enables a service |
|
||||
| W/L | SERV_DISABLE | Disables a service |
|
||||
| W/L | MSG | Shows a message to user |
|
||||
| W/L | REM / COMMENT | Annotation for developers in cooks |
|
||||
| W/L | KILL_PROCESS | Kills a process |
|
||||
| W/L | UNINSTALL | Uninstalls a software by name. (It finishes using * at Windows 'Get-Package -Name "Program*"', be care) |
|
||||
| W/L | REMOVE | Removes a file or folder path from local compuer. It's recursive |
|
||||
| W/L | SLEEP / PAUSE | Pauses execution seconds specified in param (SLEEP|3) |
|
||||
| W/L | DOWNLOAD * | Downloads a file from network to tempFolder/filename. It's required to put a filename like: DOWNLOAD|http://example.org/file.zip;filename.zip. ";" separates URL and filename |
|
||||
| W/L | EXIT | Terminates cook execution. It can take a param as error text (EXIT|Error at removing file) |
|
||||
| L | BASH | Bash command |
|
||||
|
||||
|
||||
- *DOWNLOAD: It seems to be a limit in PowerShell Invoke-WebRequest that limits this downloads to some like 128MB
|
||||
|
||||
Inside of a Cook, you can use a simple IF query:
|
||||
| OS | COMMAND | Runs if when: |
|
||||
|----- |----------------- |--------------------------------------------------------------------------------- |
|
||||
| W/L | IFSOFTWAREINST | When program is installed. |
|
||||
| W/L | IFSOFTWAREVER | When program is installed and has X version (Name;Version) |
|
||||
| W/L | IFPATHEXISTS | When if file exists |
|
||||
| W/L | IFPWCMD | When powershell command returns True (Beware of command executed if using Linux) |
|
||||
| W/L | IF64BIT | When computer is running a 64 Bit operating system |
|
||||
| W/L | IF32BIT | When computer is running a 32 Bit operating system |
|
||||
| W/L | IFWINDOWS | When computer is running Windows |
|
||||
| W/L | IFLINUX | When computer is running Linux |
|
||||
| L | IFBASH | When bash command returns True |
|
||||
| W/L | ELSE | Else of IF... |
|
||||
| W/L | ENDIF | Finishes IF block |
|
||||
|
||||
## If types
|
||||
Inside a cook, you can use IF/ELSE/ENDIF scheme.
|
||||
- IFSOFTWAREINST: Runs the if, if a program is installed.
|
||||
- IFSOFTWAREVER: Runs the if, if a program is installed and has X version. (Run with two param: "Name;Version")
|
||||
- IFPATHEXISTS: Runs if file exists
|
||||
- IFPWCMD: If powershell command returns $true (Executed succesfully), if is run
|
||||
- IF64BIT: If you are in a 64 Bit operating system
|
||||
- IF32BIT: If you are in a 32 Bit operating system
|
||||
- ELSE: Else..
|
||||
- ENDIF
|
||||
|
||||
|
||||
Reference in New Issue
Block a user