Forum Discussion
Johnnyboysydney
Nov 03, 2020Copper Contributor
Modifying a PowerShell Prompt Title called from a Start-Process
I am calling from one PS1 script to Start-Process to call another instance of PowerShell, This works as expected and the logs are being read in realtime which is what I need. But after 14 logs ope...
- Nov 03, 2020
Hi
the title should be within the script block and also make sure to use a single quote not double quote
$ScriptBlock = { $name='New Name ' #$Title = "C:\PortQryV2\readme.txt" $host.ui.RawUI.WindowTitle = $name } # Start a new PS prompt executing reading a live logfile Start-Process powershell.exe -ArgumentList "-NoExit -NoLogo -NoProfile -ExecutionPolicy ByPass $ScriptBlock"
farismalaeb
Nov 03, 2020Iron Contributor
Hi
the title should be within the script block and also make sure to use a single quote not double quote
$ScriptBlock = {
$name='New Name '
#$Title = "C:\PortQryV2\readme.txt"
$host.ui.RawUI.WindowTitle = $name
}
# Start a new PS prompt executing reading a live logfile
Start-Process powershell.exe -ArgumentList "-NoExit -NoLogo -NoProfile -ExecutionPolicy ByPass $ScriptBlock"
- JohnnyboysydneyNov 03, 2020Copper Contributor
farismalaeb Thank you so much!
Simple fix, wondering why I did not try single quotes 😛
Thanks again!