Quantcast
Channel: PowerShell
Viewing all articles
Browse latest Browse all 15370

Cannot figure this out. Weird powershell behavior.

$
0
0

I am at a loss here. I cannot seems to figure out why this script runs fine pointed at 1 list of computers and fails when pointed at another.

This is simply a script to shutdown a list of computers. The script has been working pointed a list of computers(about 20). The text file is called shutdownlist.txt

Text
shutdown-computer (get-content \\server\path\shutdownlist.txt) -credential domain\username

I wanted to test something though, so I made another list. This list only has 2 computers in it. This list is called shutdownlist2.txt and is in the exact same directory as the working list. Then I updated the script to point at that file

Text
shutdown-computer (get-content \\server\path\shutdownlist2.txt) -credential domain\username

When I changed the script to point at the other list nothing was happening so I went into powershell and manually...


Viewing all articles
Browse latest Browse all 15370

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>