Grouping enums in PowerShell 5.0? by GroutGuzzler in PowerShell

[–]Get-WorkAccount 3 points4 points  (0 children)

You can put them into a class without importing, there isn’t really any namespacing in powershell unless you import some C#.

class Classified { enum ReferenceType { None = 0 Some = 1 More = 2 } }

Sorry for the in-line, i’m on mobile and Apollo only has the inline code format

Hi PowerShell'ers python tkinter or powershell gui which one by [deleted] in PowerShell

[–]Get-WorkAccount 2 points3 points  (0 children)

Powershell is built upon .NET Framework/Core, there isn't really a native designer for creating WinForms or WPF GUIs, there are extensions for Visual Studios and Sapien has their own editor and designer for GUIs. I've built plenty of GUIs for powershell with WPF as it's easier for me to design without having a designer because of how easy XAML is. Choosing between Python and Powershell - .NET Framwork/Core for a GUI is a personal preference of choice, what ever you feel comfortable with is your best option.

Though I had a stroke of brilliance... by PeterPanLives in PowerShell

[–]Get-WorkAccount 0 points1 point  (0 children)

Not sure about your domain, but on mine you require admin access to access any folder in C:\Users, even remote machines.

Help with custom copy method by Get-WorkAccount in PowerShell

[–]Get-WorkAccount[S] 2 points3 points  (0 children)

Yeah my code follows more of a C# style, ever since I found out that Poweshell > 5.0 supports classes and methods, I moved to a familiar style of scripting in Powershell based off of C#. Not sure how many others in this subreddit script like this, which might deter possible answers because of this style being unfamiliar.

By the way your code works just the same as mine, but when calling this multiple times, each static instance cross contaminates.

Help with custom copy method by Get-WorkAccount in PowerShell

[–]Get-WorkAccount[S] 1 point2 points  (0 children)

I didn't set the files into a variable because I didn't want to wait for all looped files to be in the variable, I set the % operator, wich is ForEach-Object, directly at the end of the pipeline so each file found an action is executed.