pwshguy (mdowst)

Father, author, blogger, enthusiast of all things PowerShell and automation. http://linktr.ee/mdowst

  • 76 Posts
  • 28 Comments
Joined 1 year ago
cake
Cake day: June 8th, 2023

help-circle



  • Just looking at it from the point of view of making the script more portable and easier for someone else to run, there are a few things I would address.

    The first is the Write-Host commands all over the script. I would recommend converting those to Write-Verbose. Here is a great explanation when to use Write-Host vs other outputs.

    There are also numerous Write-Output commands in the script. Anything sent to the Write-Output will be returned to the calling console. If you need to take additional actions based on the results of this script, this could cause issues. You can run into problems with the New-Item commands in there too, as they will produce output. You might consider saving them to a variable or piping to Out-Null.

    Also, there is no need to call exit and set an exit code in the way you are. If you want to write and error but have the script continue you can use, Write-Error. If you want the processing to terminate then use throw. Doing it this way will allow PowerShell’s built-in error handling to take care of the exit codes. It will also give you greater flexibility with using Error Action Preferences and using try/catch statements.

    Finally, you have a path hardcoded for the workingDir. I would suggest making this a parameter or using an environment variable as this will make it more portable. Also, when creating the log variable, you will want to use the Join-Path cmdlet instead of just joining strings.














  • Community

    • Kubernetes is Easy with Anthony Nocentino
      In this episode of the PowerShell Podcast, we sit down with Anthony Nocentino, a Senior Principal Field Solution Architect at Pure Storage, to dive deep into the world of Kubernetes. Anthony breaks down what Kubernetes is and how it fits into the modern IT landscape. We explore his fascinating career journey, from consulting and SQL Server to educating the masses on Kubernetes and Linux. Anthony also shares invaluable insights on becoming a force multiplier in your career and the critical role of mentorship and offers sage advice for anyone looking to elevate their professional path.
    • PSSaturday Karlsuhe Call for Speakers
      We are excited to announce that we are looking for speakers for the upcoming PSSaturday in Germany this November! Whether you’re a first-time speaker or an experienced presenter, we welcome you to share your ideas. If you have an interesting topic and are willing to speak for up to 45 minutes, we want to hear from you.










  • Projects, Scripts, and Modules

    • 365AutomatedLab and new companion module coming soon
      365AutomatedLab and new companion module coming soon I promise I haven’t forgotten about 365AutomatedLab, but I’ll be honest after Microsoft made the announcement of no more new Dev tenants it hurt a bit as I know how useful they are on learning and testing features and PowerShell without hurting your production environment.
    • How to Create SharePoint List & Add Columns Using PnP PowerShell?
      Recently, I developed one Power Apps application that needed a SharePoint list data source. Before running the application, the client must create the specific SharePoint list on their site. So, I wrote a Power Shell script to create the SharePoint list along columns to avoid mistakes when creating it manually.
    • PowerShell-Yayaml v0.5.0
      What’s changed…
    • PSDates v1.0.4
      Tons of new stuff added including calculating sunrise and sunset time.

    Books, Media, and Learning Resources

    Community

    • Behind the Scenes at PSConf.EU: Harm Veenstra’s Experience and Insights
      In this episode of the PowerShell Podcast, we sit down with Microsoft MVP Harm Veenstra to discuss his exciting experiences at PSConf.EU, where he attended for the first time and embarked on a new journey into public speaking. Harm shares his thoughts on receiving the prestigious Microsoft MVP award and delves into his recent projects, including creating a TCP/UDP listener for testing firewall ports and using a Pi-hole to block ads on his home network. We also explore his perspectives on automation in the MSP world, the power of Microsoft Graph, and why he hasn’t yet adopted AI tools. Tune in for an engaging conversation filled with insights, tips, and highlights from PSConf.EU!
    • Write Code, Write Blogs: Lessons with Brock Bingham
      In our latest Powershell Podcast episode, we chat with Brock Bingham. We explore his transition from sysadmin to writer and his viewpoint of coding as creative problem-solving. Brock also shares insightful blogging tips and advises against the pitfalls of comparison. A must-listen for aspiring PowerShellers. (plz create a blog and share your learnings for future you)



  • Community

    • PipeScript, Formatting, and Docker: An In-Depth Conversation with James Brundage
      In this episode of the PowerShell Podcast, we are joined by Microsoft MVP, former PowerShell team member, and module maker extraordinaire James Brundage. We hear about his experience at Microsoft Build, learn all docker and kubernetes while discussing his Rocker module, UserGroup updates, implicit interpretation in Pipescript, formatting and types, and so much more. Strap in because we go deep in this one.
    • Breaking Down ModuleFast and More with Justin Grote
      In this episode of the PowerShell Podcast, host Andrew Pla interviews Microsoft MVP and PowerShell aficionado Justin Grote. They delve into an issue in the Az.Accounts 3.0.0 module, with Justin offering insights and a workaround (use an earlier version of the module). Justin also discusses his innovative ModuleFast project, explaining its architecture and his approach to writing PowerShell scripts and modules. The conversation highlights Justin’s passion for APIs and celebrates his contributions as an official PowerShell project contributor. Listeners get a glimpse into Justin’s workflow working at a Managed Service Provider (MSP) and how he writes to much PowerShell. He offers valuable advice for those early in their careers. Additionally, Justin shares updates on his PowerHTML (1.2m downloads) project, which originated from a GitHub pull request, showcasing his continuous contributions to the PowerShell community.
    • PowerShell Community Call - May 16th, 2024
      Last month’s community call with the PowerShell team.





  • If I understand correctly, the signatures generated by PuTTY aren’t perfectly random, so if someone got a hold of a bunch of keys from a server, they could figure out the pattern. It takes about 60 keys. This affects not just PuTTY, but also FileZilla, WinSCP, TortoiseGit, and TortoiseSVN.

    In other words if you have NIST P-521 keys, or any others using 521-bit ECDSA, you should revoke them and generate new key pairs. After you update your software.






  • I feel down a rabbit hole, a few years ago wonder the same thing about C#. Here is what I found.

    • C# was developed in 2000 as a successor to C++. Doubling the ++ to a #.
    • C++ was developed in the early 80s as a successor to C. Adding plus (+) to a name was a common way of indicating it was an enhancement. Also ++ is the incrementing operator for C.
    • C was developed in the early 70s as a successor to the B programming language. C comes after B.
    • B was developed in 1969 and was derived from the BCPL language. Basically, B was a stripped down version of BCPL.
    • BCPL (Basic Combined Programming Language) was developed in 1967 and was a designed as an simpler version of CPL.
    • CPL (Combined Programming Language) was developed in the early 60s at Cambridge. The original name was “Cambridge Programming Language” but was changed to Combined when it was published jointly with the University of London.