Forum Discussion

Alan1679's avatar
Alan1679
Copper Contributor
Sep 15, 2026
Solved

How to save powershell script to a text file on desktop?

I am learning out-file and I want to save this to desktop as text file. get-date | get-member -name "AddM*" | out-file -filepath "C:\Users\yungm\desktop \ test.txt" It doesn't work. What did I do w...
  • nrvonogd's avatar
    Sep 17, 2026

    I'd probably suggest formatting your code, but you have space after desktop in your path which is probably ur issue. I also would remove the space before test, but technically that would work. before test, that's probably the issue.