Main Menu
  • Home
  • bexxx?
    • Profile
    • Misc
    • Programming
    • Biking
    • NYC Marathon Training
    • Hamburg Marathon 2008
Login



  

  • Forgot your password?
  • Forgot your username?
  • Create an account
Home > bexxx? > Misc

About bexxx

Logging all output in PowerShell

PostDateIcon Thursday, 15 April 2010 21:20 | PostAuthorIcon Author: bexxx | PDF Print E-mail

The problem with logging in PowerShell is that it does not capture all output, especially the one from other executables.

I've ran into this issue when one of my PowerShell scripts did not run properly as a scheduled task.

Instead of using the logging mechanisms of PowerShell I simply used output redirection which only works correctly because I've used cmd to execute Powershell with a given script.

The action of the scheduled task looks like this now:

cmd /C C:\Windows\System32\WindowsPowershell\v1.0\powershell.exe -command scriptname >> logname.txt 2>&1

The > symbol is a redirection into the given output file. Using >> instead of > appends the content instead of creating a new file each time it is called. The 2>&1 part redirects the output of stderr into stdout, which enables the logging of error messages as well. If you skip this there won’t be error messages in the log file.

Sidenote: I knew this from unix shells and was quite surprised to find that in the oldschool cmd as well!

 

File Sharing Problems between Snow Leopard and Windows 7

PostDateIcon Tuesday, 29 September 2009 18:50 | PostAuthorIcon Author: Ralf Beckers | PDF Print E-mail

After upgrading my Leopard to Snow Leopard and my WIndows Vista to Windows 7 RTM, I could not access my shared files of my mac with my Windows.

To solve this, I had to remove my shares and create them again. For another user I had to reset the password.

Hope this helps if you experience the same issue on your systems.

 

 

 

Grenzritt

PostDateIcon Monday, 06 April 2009 19:47 | PostAuthorIcon Author: Ralf Beckers | PDF Print E-mail

Eigentlich wollte ich mich diesmal einer Gruppe anschliessen und bin auf gut Glück zum Treffpunkt. Leider erschien keiner, also musste ich selbst gucken wo ich bleibe, bzw. fahre. Da ich mich ab dem Waldstadion nicht besonders gut auskenne sollte es wieder mal auf Erkundungstour gehen.

Read more...

 

Spurensuche

PostDateIcon Monday, 06 April 2009 19:44 | PostAuthorIcon Author: Ralf Beckers | PDF Print E-mail
Diesmal ging es wieder mal in Bekannte Gegenden, aber ich habe die Augen offen gehalten um zu sehen wo Bikespuren verlaufen.

Read more...

 

Viel Niederlande

PostDateIcon Tuesday, 31 March 2009 17:25 | PostAuthorIcon Author: Ralf Beckers | PDF Print E-mail
Diesmal ging es für mich in eine ganz andere Richtung :) Beim Golfplatz hintern Klinikum habe ich einen schönen Trail gefunden, der am Ende einen tollen Ausblick bot.

Read more...

 
More Articles...
  • Spinning++
  • Convert to PowerShell
  • Kleine Runde mit Rich
  • Wie unfit

<< Start < Prev 1 2 3 4 5 6 7 8 Next > End >>

Page 1 of 8

Copyright © 2009 ---.
All Rights Reserved.

Webdesign Tirol designed by pc-didi.