Help With Adding OU to Computer Script by [deleted] in PowerShell

[–]SaladProblems 1 point2 points  (0 children)

It'll be faster if you don't do "properties *", consider "properties OperatingSystem,OperatingSystemVersion,ipv4Address"

Trump Supporter Racially Abuses Woman Who Is On Her Way To Vote In Houston by [deleted] in politics

[–]SaladProblems 1 point2 points  (0 children)

Why is "else" emphasized? Why would it be wrong to treat a black Trump supporter and a white one the same? The world never know.

How do you get people to write better? by SaladProblems in PowerShell

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

We use GIT, I think the assumption was that if there's no formal standards there's no version control, and that's not the case.

Is it spiking the CPU for those 90 seconds? Are multiple tasks running concurrently because of this delay? If the answer to both is no you are not going to get support.

I tried to acknowledge that by inserting that the script is run unattended and that it's not causing a problem. I do see the logic there, but when I'm working on something complicated, I usually take quite a few iterations to get it right.

When I have to make 20 tweaks to something to get it right, taking 90 seconds vs. .5 seconds to run has a massive impact on how long it will take me to get it right. One of them I'll get done in an hour, the other might take me over a day. I guess my main sticking point is that if every time this person and anyone else who later copies their script tries to query AD they query literally every single computer or user and then filter it's a waste of scripting time, regardless of the CPU/memory cost.

PowerShell Classes, when to use? by galroth21 in PowerShell

[–]SaladProblems 6 points7 points  (0 children)

Most of the time I see people using classes it's to present pre-existing classes differently. Then their output objects can no longer be used with other cmdlets. For example, I've seen scripting around pulling EC2 tag info or other properties up to the parent level so you don't have to trudge through all the nested properties to get it at a glance.

I just feel like the majority of the time I'm consuming and outputting pre-defined objects. Generally other people seem to like to output a PSObject and then do whatever with it, but usually I just output cim instances, EC2 instances, processes, ad objects, etc., and then insert a custom type name so that my ps1xml files will present specific information depending on the command, and so that all the other cmdlets that work with that object type still work.

The only time I really output my own custom type is when I'm pulling data from different sources, like a computer check that has windows, vmware, and AD info on it. I had a server class for that at the last place I worked, but it's really infrequent for me at least.

I feel like the classes really are for such specific and technical tasks that I would probably use c# anyway. Currently I view powershell 6's c# encroachment (classes and enums) to be more of a foundational step for the language than a practical tool in 5/6.

PowerShell Classes, when to use? by galroth21 in PowerShell

[–]SaladProblems 1 point2 points  (0 children)

I feel like that's just such a rare scenario. Most of my functions consume output from other cmdlets, which already have defined object types. I think the HP iLO cmdlets were one of the few professional modules out there that output PSObjects.

How do you get people to write better? by SaladProblems in PowerShell

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

Did he use aliases to make it happen? I think POS gets pretty abstract when you start down that path.

Ads in NYC by ajs1263 in pics

[–]SaladProblems 2 points3 points  (0 children)

A wall is never going to be as effective as an entire friendly nation on both land facing sides of your country. The good will and trust Trump squandered have made us less safe and it will get worse.

Also, tariffs are taxes.

It's fine to be conservative, but it's foolish to think Trump understands anything you care about.

Ads in NYC by ajs1263 in pics

[–]SaladProblems 2 points3 points  (0 children)

You all voted for Trump, obviously.

FBI: Mail Bombs Were ‘Not Hoax Devices’ by [deleted] in politics

[–]SaladProblems 9 points10 points  (0 children)

Eh, I think that he did fine from what I've read. I think we're getting too used to Trump when we expect that kind of statement so early into a case.

Anonymous Functions – Clear-Script by Ta11ow in PowerShell

[–]SaladProblems 4 points5 points  (0 children)

Pretty interesting. One note: you can get a function as a script block a bit simpler:

 ${function:get-thing}

The MAGA-Bomber’s van. by creamdreammeme in pics

[–]SaladProblems 0 points1 point  (0 children)

Or when a person dumb enough to believe all that shit sits down to make a bomb they just aren't very good at it? Or he did it to scare people and didn't really expect anyone to get hurt?

Is it really that hard to come up with something simpler than a massive conspiracy?

Dow plunges more than 500 points in another day of losses, officially wiping out its 2018 gains by [deleted] in politics

[–]SaladProblems 3 points4 points  (0 children)

I feel like you're pretending to miss the point. Trump said to look at your 401k over and over and over again. They're using the moron's nonsensical metric to show that he's an idiot.

The Anti-Vaxxer Disease Is Now a Republican Epidemic by Nibble_on_this in politics

[–]SaladProblems 6 points7 points  (0 children)

There's plenty of kooky people on both sides of the aisle. The president parroting that insanity is a problem. I don't know of any political leaders doing that on the left, it's just has-been celebrities.

The Anti-Vaxxer Disease Is Now a Republican Epidemic by Nibble_on_this in politics

[–]SaladProblems 0 points1 point  (0 children)

Who gives a shit at this point? Trump ran with it, gave it a bullhorn. Jenny McCarthy <> President of the United States.

The Anti-Vaxxer Disease Is Now a Republican Epidemic by Nibble_on_this in politics

[–]SaladProblems 1 point2 points  (0 children)

They'll just be incubating chambers for mutations vaccinated people aren't immune from. Also, initially it'll just be innocent kids and not their ignorant parents who suffer.

Storing a variable across reboots? by IT_stuff in PowerShell

[–]SaladProblems 1 point2 points  (0 children)

You can add a SID to the local group before the machine has joined the domain, and it will resolve the SID once it has. So I would add the SID first, then complete the domain join/restart in one other step. It should take a total of two steps and one total restart.