Paul Broadwith

Results 490 comments of Paul Broadwith

@Schwitzd The #Requires directive applies to everything in the file (ie. script) that it's in. If you want to test a function is being run from an Administrator / elevated...

@Schwitzd If you have two functions in the same file with the `#Requires` you will get the error running the script, dot sourcing it or importing it (if it's a...

@darkoperator It's handy for putting at the top of the Module Script file. That and the Manifest are the two important module files so they will likely be opened and...

> What you think about to write this on the style guide? @Schwitzd I'm not sure what you mean by that?

> You can't guarantee anyone coming along later will know what a particular alias means Complete agreement. But you also can't guarantee that the alias you're using in your code...

> The vast community has this discouraged in scripts incorrectly. > The only reason to not use a specific subset of items, would be deprecation of aliases which is only...

I believe the current thoughts is that PSScriptAnalyzer within VS Code flags the rule violations up but it's up to you to resolve them. Which I think is a nice...

> I thought this would be very useful to ensure users provide the correct object with ist required properties @Ocram85 that is exactly what I use them for. As has...

Totally agree. I tend to use it for things like configuration data that I need to be sure is in a specific format. But I'm really not sure why it's...

Reability is more important and having it all on one line makes it more difficult to understand at a quick glance. If your code is more readable over multiple lines...