$text = "Your text goes here"
$filePath = "C:\path\to\your\file.txt"
$text | Out-File -FilePath $filePath
Start-Process notepad.exe $filePath