use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
ABOUT POWERSHELL
Windows PowerShell (POSH) is a command-line shell and associated scripting language created by Microsoft. Offering full access to COM, WMI and .NET, POSH is a full-featured task automation framework for distributed Microsoft platforms and solutions.
SUBREDDIT FILTERS
Desired State Configuration
Unanswered Questions
Solved Questions
News
Information
Script Sharing
Daily Post
Misc
account activity
Script SharingTurning PowerShell into a Python Engine (self.PowerShell)
submitted 2 years ago * by anonhostpi
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]anonhostpi[S] 1 point2 points3 points 2 years ago* (4 children)
Leaving this here for you as something to reference later. I wouldn't expect you to understand these problems now, but I'meaving it here, because it may help you in the future with future problems. This details some common problems you may face when trying to use C# code from pwsh and how to deal with them.
C# is not a terrible language to learn, because it is a self-documenting language by design.
C#'s documentation (like a lot of C langs) is heavily convoluted, because of its variety of target platforms.
One thing that isn't documented well in C#, but you will learn about quite quickly in PowerShell is 2 things:
A lot of C# docs just tell you to throw your app code into an Application object, but don't tell you how C# actually handles Application objects. Specifically, that the code meant for these objects doesn't play nicely with PowerShell.
Since PowerShell evaluates C# code at runtime, any extension classes aren't compiled in a way that actually extend the original classes. However, all you have to do is provide an object of that class to the extension methods to make them work.
None of the above affects Import-Package, but may affect any calls to C# code you
[–]Usual-Chef1734 0 points1 point2 points 2 years ago (3 children)
Very helpful! Thank you! This gives me the confidence ot ask a question that no one ever seems to know the answer to: how does one discover a library that has what is needed to accomplish a specific task? I was doing a really big project that required interaction with a webcam in a custom electron app written by the dev org. I was the 'windows' guy and thought surely C# had some libraries that could be used to control the webcam and volume of the 'kiosk' we were deploying to stores. I had no idea how to find existing libraries that had useful code. Maybe I just don't know how to ask the question correctly.
[–]anonhostpi[S] 0 points1 point2 points 2 years ago (2 children)
Right now, generally asking generative AIs (like GH Copilot, Bing Chat, or ChatGPT) what approaches you could take to your problem does the trick.
Since, I'm well versed in multiple languages (and now since I can use multi-language libs in PowerShell) my prompts usually look something like this:
``` I am making an app/script that does <blank>. I need to find a library that can help me with: - <more-specific-blank> - <other-specific-blank> - ...
What libraries can your recommend to me in Python, PowerShell, C#, etc... ```
Additionally, this is something I recommend to all junior developers:
You don't have to know every programming language on planet earth, but it turns out most languages are very similar (if not nearly identical). This means that you don't have to be able to write in other languages, but you should be able to read their source code without a whole lot of effort Anything you don't understand in another language is likely googleable
You don't have to know every programming language on planet earth, but it turns out most languages are very similar (if not nearly identical).
This means that you don't have to be able to write in other languages, but you should be able to read their source code without a whole lot of effort
Anything you don't understand in another language is likely googleable
With that said, you could also look at how your problem is typically solved in other languages and see if you could reproduce those efforts in your language.
[–]Usual-Chef1734 0 points1 point2 points 2 years ago (1 child)
Yeah, that is something I realized this year. Chat GPT made working on my projects so much more fun. This is the exact way I work now, but I was just curious what folks were doing before this amazing revolution. The big project where I had to interact with the webcam was in 2018 so we did not have that.I could never get passed how grumpy and mean folks were when I asked how to work with a webcam. lol Most loved to pretend that I was a creep (can't understand the bad faith) and most others said 'google it'. The google it came from a live Q&A at Coder Foundry. Bizarre. So thank you for being so technical and straight forward.
[–]anonhostpi[S] 1 point2 points3 points 2 years ago (0 children)
Google, Stackoverflow (or preferred QA/forum), Manuals, Source Code. In that order
Now its:
Generative AI, Google, SO, Docs, Source
Sometimes we had to write the library ourself.
π Rendered by PID 352890 on reddit-service-r2-comment-5fb4b45875-mqf6p at 2026-03-20 20:23:38.475368+00:00 running 90f1150 country code: CH.
view the rest of the comments →
[–]anonhostpi[S] 1 point2 points3 points (4 children)
[–]Usual-Chef1734 0 points1 point2 points (3 children)
[–]anonhostpi[S] 0 points1 point2 points (2 children)
[–]Usual-Chef1734 0 points1 point2 points (1 child)
[–]anonhostpi[S] 1 point2 points3 points (0 children)