Tuannna1
(Tuan Anh)
1
Hi everyone,
@Yoichi
I am trying to write logs to a file when using the “Invoke PowerShell” activity, but I have not been successful so far.
$logFilePath = "E:\Test\log.txt"
$FolderPath = "E:\UiPath"
Start-Transcript -Path $logFilePath
cd -Path $FolderPath
php test.php --src $FileName --type $FileType
Stop-Transcript
Is there a way to do it?
Thanks in advance,
1 Like
Manish540
(Manish Shettigar)
3
Hi @Tuannna1 ,
Check this below workflow attached,
Uipath_WriteTextFileUsingPowershell.xaml (5.7 KB)
Files Used:
Test.txt (25 Bytes)
Powershell script:
Param(
[Parameter(Mandatory=$true)] [string]$logFilePath,
[Parameter(Mandatory=$true)] [string]$textToWrite
)
Add-Content -Path $logFilePath -Value $textToWrite

Parameters Passed:
Hope this helps 
3 Likes
Manish540
(Manish Shettigar)
4
Hi @Tuannna1 ,
Also look into this below link,
1 Like
Yameso
(Jakub Swiderski)
5
Any reason for not using append text file activity?
system
(system)
Closed
6
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.