---
title: "Discussion on \"Conditionally Redirecting Output from Inside a Powershell Script File\" | Hashnode"
description: "Discussion on \"Conditionally Redirecting Output from Inside a Powershell Script File\". If you look at documentation and examples about output redirection in Powershell, you'll often find code showing you how to redirect e.g. Write-Warning on the command line level like shown here:\n.\\script.ps1 3> warnings.log\n\nUsually, it's best practi..."
url: "https://hashnode.com/posts/conditionally-redirecting-output-powershell-script/64dfadf9e65399cca3f6f256"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Conditionally Redirecting Output from Inside a Powershell Script File](https://sysdive.net/conditionally-redirecting-output-powershell-script?utm_source=hashnode&utm_medium=feed)

If you look at documentation and examples about output redirection in Powershell, you'll often find code showing you how to redirect e.g. Write-Warning on the command line level like shown here: .\\script.ps1 3> warnings.log Usually, it's best practi...

Aug 18, 2023 · 3 min read · sysdive.net  
Read the article

-   [#powershell](https://hashnode.com/tag/powershell)
-   [#scheduled-task](https://hashnode.com/tag/scheduled-task)
-   [#output-redirection](https://hashnode.com/tag/output-redirection)
-   [#write-warning](https://hashnode.com/tag/write-warning)

## Written by

[Marcus Schommler](https://hashnode.com/@mschomm)

@mschomm · Cologne, Germany

  
[View profile](https://hashnode.com/@mschomm)

Using Powershell for IT systems management

Started as a software developer specialized in UI and database design, later moved into IT systems administration. Working mainly with infrastructure and services based on Windows Server (Exchange 2016, Active Directory, WSUS, MDT, ...) and VMWare vSphere.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
