[-] discusseded@programming.dev 5 points 1 month ago

I'm sorry, but I have respect for a guy who can expertly sex up his partner. A guy who sees sex as filthy and indignant? Nope, I don't respect that crap

Through my eyes the first guy has dignity, the second has problems.

[-] discusseded@programming.dev 2 points 1 month ago

"Thank goodness water has memory."

-Elsa

[-] discusseded@programming.dev 2 points 3 months ago* (last edited 3 months ago)

This blog does a fairly straight-forward job on explaining the basics. For me, I learn best in an interactive 1:1 or well-constructed video, so ChatGPT was priceless. I could ask it stupid questions all day long, and after throwing some different ideas around I started to see the essential parts and just let my prior knowledge of PS, .NET, and C# WPF take it from there.

At the end of the day, all that really matters is using the PresentationFramework assembly and creating a window:

  • Add-Type -AssemblyName PresentationFramework
  • Either use Visual Studio > WPF Project and make the UI you want. Take the XAML file and use PowerShell to get the raw content:
    • $Xaml = Get-Content -Path MainWindow.xaml -Raw
    • $SanitizedXaml = $Xaml -replace "bad syntax e.g. Foreground={x:Null}" "Foreground="Transparent" # Certain XAML syntax is incompatible with PS XML
    • [xml]$XmlReader = [System.Xml.XmlNodeReader]::new($SanitizedXaml)
    • $Window = [Windows.Markup.XamlReader]::Load($XmlReader)
  • Or, use .NET-style syntax in PS directly:
  • Then show the window:
    • $Window.ShowDialog() | Out-Null
[-] discusseded@programming.dev 2 points 3 months ago

I appreciate the feedback. For the Linux side it's for personal projects and learning opportunities so starting with something familiar and growing from there is my goal.

I dabble in C and C++ so cli isn't out of the question for me. But .NET is my comfort zone, and I like the rapid tooling that PS offers.

I have multiple reasons to dig into Python so really I just need to get on with it.

[-] discusseded@programming.dev 1 points 3 months ago

Python is always something I intend to learn but never get around to. Does it natively handle GUI for process tooling or does it require a third party? What makes PowerShell so useful to me is the native ability to create visual applications without the need to compile. I can create tools for my company that launches right out of ConfigMgr Software Center and other technicians can contribute without needing a programming background.

At home I want to mess around with tooling for home services without having to resort to web development.

[-] discusseded@programming.dev 3 points 3 months ago

By far it's the object pipeline. Having structured data makes it easy to automate workflows in a predictable way. With bash everything is a string, so everything has to be parsed. It's tedious.

It took about a year of steady use before I came to enjoy the syntax. It shines in a production environment with other cooks in the kitchen. I never got into the C style, I like my code human readable at a glance. It's fine if everyone's a sage but we have a team with a mixture of skill levels and for me PowerShell gets it right.

[-] discusseded@programming.dev 1 points 3 months ago

I did install it on one of my machines but haven't dug in yet. I'm curious to see how much of my workflow will translate to Linux, yet at the same time I want to make sure I'm actually learning Linux and not using PS as a crutch.

[-] discusseded@programming.dev 1 points 3 months ago

Thanks for the reference. I'm looking at it and I think you're right.

[-] discusseded@programming.dev 15 points 3 months ago

After learning PowerShell and then moving to Linux and having to learn bash...I don't get this sentiment. PS is the shit. I can make full GUI applications and automate all kinds of workflows. Their use of objects makes it so easy to extract data and utilize it. Bash feels so much more primitive and clumsy by comparison. What am I missing here?

view more: next ›

discusseded

joined 1 year ago