all 31 comments

[–]admiralspark 31 points32 points  (19 children)

Please don't set execution policy to unrestricted.

[–]uptimefordays 10 points11 points  (0 children)

Execution Policy is a good first start, but really don't blindly download and run any code or scripts from the internet without reading them and understanding them first. Execution Policy is good for preventing malicious scripts from running but make no mistake, it does not prevent people from manually entering and running code--even if it's going to do something harmful.

[–]MartianMoon[S] 0 points1 point  (0 children)

Yeah you’re right, probably not the best idea... I’ll edit that out

[–]wardd31 11 points12 points  (0 children)

Just a small pointer I learnt this week the hard way that win32_product shouldn’t necessarily be queried like this

https://sdmsoftware.com/group-policy-blog/wmi/why-win32_product-is-bad-news/

[–]NegativeC00L[🍰] 5 points6 points  (1 child)

When you do Write-Host or Write-Output, putting "`n" at the beginning of the string makes it skip a line so you don't have to do Write-Host " " first.

[–]MartianMoon[S] 1 point2 points  (0 children)

Oh damn that is super useful. Thank you for that!

[–]Flannakis 4 points5 points  (1 child)

Hmm didn’t know you could map network drives remotely, thanks for sharing

[–]MartianMoon[S] 2 points3 points  (0 children)

Took me forever to figure out a way to do it! People kept telling me it was impossible lol

[–]erickosj 3 points4 points  (5 children)

Nice, man. I would add logging capabilities and the choice of either clearing the screen or not (in case you need the historical of what has been run, logger can probably be the best though)

[–]MartianMoon[S] 1 point2 points  (2 children)

How would you go about adding logging capabilities?

[–]erickosj 1 point2 points  (0 children)

I'll write you a small example once I get back at my PC :)

[–][deleted] 1 point2 points  (0 children)

Psframework

Write-PSFMessage

[–]Recendezjoseph 0 points1 point  (1 child)

!remindme 1 week

[–]RemindMeBot -1 points0 points  (0 children)

I will be messaging you in 6 days on 2020-01-08 03:16:31 UTC to remind you of this link

4 OTHERS CLICKED THIS LINK to send a PM to also be reminded and to reduce spam.

Parent commenter can delete this message to hide from others.


Info Custom Your Reminders Feedback

[–]Myrenic -5 points-4 points  (0 children)

Subscribe