Are you are using Run Process? If so, you probably want to not use > myfile.txt but rather stdout=myfile.txt (see the Process configuration link in Run Process help). if you don’t actually need the result in a file, just need to test the output you might want to look at ${result.stdout} also mentioned in the documentation.
Otherwise can you show us what your trying to do so we can guide you better.
Hi All,
I created one powershell script for uninstalling postgresql
and trying to run from robotframe work file .The testcase is passed but postqresql is not uninstalled.
*** Settings ***
Library Process
*** Variables ***
${uninstallerPath} C:\Users\Ps\Downloads\powershell\uninstall-postgresql.ps1
*** Test Cases ***
Uninstall PostgreSQL
${result}= Run Process powershell.exe -File ${uninstallerPath} shell=$True
Any idea on how tonrun powershell scrit from robot framework
Hi @damies13
sorry i i used \ only
*** Settings ***
Library Process
*** Variables ***
${uninstallerPath} C:\Users\Ps\Downloads\powershell\uninstall-postgresql.ps1
*** Test Cases ***
Uninstall PostgreSQL
${result}= Run Process powershell.exe -File ${script_path} shell=$True
In robot framework (and in most programming languages you need to escape the \ character, it’s because a reserved character. The link I gave you is where it tells you that in the documentation.