About 50 results
Open links in new tab
  1. How to output something in PowerShell - Stack Overflow

    Jan 11, 2010 · Write-Output "test1"; Write-Host "test2"; "test3"; then, if you call the script with redirected output, something like yourscript.ps1 > out.txt, you will get test2 on the screen test1\ntest3\n in the …

  2. How to write to the console in PowerShell? - Stack Overflow

    May 31, 2012 · The best way to write to the console would be using the Write-Host cmdlet. When an object is written to the pipeline it can be consumed by other commands in the chain.

  3. How to run a PowerShell script with verbose output?

    Dec 26, 2016 · I'm wondering if there's a way to run a PowerShell script such that both the commands and the output of each line of the script are printed. For example, in Bash you would write bash -x …

  4. scripting - How to redirect the output of a PowerShell to a file during ...

    I have a PowerShell script for which I would like to redirect the output to a file. The problem is that I cannot change the way this script is called. So I cannot do: .\MyScript.ps1 > output.t...

  5. powershell - Is there a way to specify a font color when using write ...

    I have a powershell script that gives some status output via write-output. I am intentionally not using write-host because the output may be captured and written to a logfile like this: ./myscript...

  6. scope - Variable scoping in PowerShell - Stack Overflow

    Feb 17, 2012 · different scope. The copy on write issue you're seeing is because of the way Powershell handles arrays. Adding to that array actually destroys the original array and creates a new one. …

  7. How to read/write to a USB Serial COM port using powershell?

    May 14, 2023 · 2 Writing and Reading info from Serial Ports [3] Serial Port communication using PowerShell [4] Reading Serial port data continuously in powershell script [5] How to continuously …

  8. Create Log File in Powershell - Stack Overflow

    Log : The term 'Log' is not recognized as the name of a cmdlet, script file, or operable program. Check the spelling of the name was included, verify that the path is correct and try again. Do you have a log …

  9. How do I write an inline multiline powershell script in an Azure ...

    The yaml schema for a Powershell task allows you to select targetType: 'inline' and define a script in the script: input. But what is the correct format for writing a script with more than one li...

  10. PowerShell, tell a script to output all errors to a text file

    Nov 3, 2022 · 3 I have a PowerShell script that is the startup script for Windows Sandbox and so it runs silently. Is it possible to put some kind of declaration within a PowerShell script, say at the start of the …