PowerShell 7 - Scaffold Structure (Follow-up)

Some interesting hurdles crossed with this simple philosophy:

Organize custom functionality in a structured, standard format.

Main Scaffold

  • "Process" and "Begin" segments
  • Status Notifications - Output Logging
  • Exception Handling - Generically
  • Artifact Publishing

Custom Structure

  • AssertParameters (arg testing/validation)
  • MainProcess
  • $Script:Artifact.Data
  • $Script:Artifact.Files

Notes

  • Simple dot sourcing the "custom" script, does not pull in $Script:args variables. (Must explicitly pass $Script:args)
  • Almost ready for 'main' branch merge

Laptop w/ new Ubuntu 20.04 LTS Desktop

 I recently had to install Ubuntu Desktop on a laptop that had a problematic NVidia chipset: The system would always freeze in a very short amount of time - most likely due to a combination of overheating and/or bad drivers.

This article saved the day: https://itsfoss.com/fix-ubuntu-freezing/

I just changed the GRUB config for the initial start of installation and everything worked without a single glitch. Even post-install, I did not have to change the grub config 

Essentially, appending `nomodeset` to the line containing `linux` bypassed the default video check (even though it was listed during setup). Getting to the initial grub config with selecting the "lite" version of the USB partition.

PowerShell Experiment: Standard Scaffold w/ Custom Functions in External File

 So while I was working on the last project to "Factory Out" Modules w/ Plaster, it dawned on me: why stop there?

Having a standard script outline, that's a template in VS Code, over and over the same steps to make the current script unique -- editing in just the "right places" seems cumbersome when, down the road, you have to update/add functionality, remembering where everything is in this already giant script.

All of this to say:

  1. Start with a scaffold 'main.ps1' script, that is never touched.
  2. Create a unique or 'functions.ps1' script file that is the meat of what needs to be done.
The "old way" was to create the new script file and jumble it all together. What I've found is that this is no different (really) in using the "proper" Begin/Process structure - as far as support.

In the 'main' file, it would handle the "big 3", standard checks and balances:
  1. Argument Testing
  2. Main Function Execution
  3. Output/Artifacts
The unique or 'functions.ps1' file, it would contain 
  1. all arguments/params for itself (using the $args array)
  2. standard "MainProcess" function
We'll see how it goes.

Scaffolding PowerShell Modules with Plaster

Plaster is a very novel idea, but in practice I can see why it's gone mostly untouched for a while. There is a rather steep leaning curve for what it does.

These are the goals Plaster is trying to achieve:

  • Scaffold a base PowerShell Module project based on prompted parameters
  • Allow for flexibility in the above process by incorporating custom scaffolding processes
The former is indeed desperately needed. It's a good, solid, repeatable and consistent way for module to be created.

The latter thou, makes the process needlessly complex, because: Who Generates the Generators? There are lot of good docs on the process, but even their own examples are either outdated or just wrong.

In the end, I wound up creating a template based on the mega example that asks for options such as: Pester test, Psake building,  PlatyPS doc gen, and Git with editor VS Code.

First time running the project from the template, Psake puked a bit - trying to find the name of the module, so I updated the Plaster Template to inject the name of the given module into Psake's settings file, vs how Psake attempts to get the Module Name.

I'm pretty happy with the work accomplished. I seriously don't see a real need to go beyond the template I created. I know a lot of hard work went into Plaster, but I can't see myself using multiple templates, when I can just make an uber template and customize during "plaster up" time.


WSL - Installing Fresh on Win10 in 2021

Installed with:

choco install wsl -y

Continued install with: https://docs.microsoft.com/en-us/windows/wsl/install-manual

While moving from WSL 1 to 2, had this pop-up:

Virtual hard disk files must be uncompressed and unencrypted and must not be sparse

... and after a quick Google-Foo:

https://simplernerd.com/wsl2-uncompressed/

  • cd ~\AppData\Local\Package\CanonicalGroupLimited.Ubuntu20.04onWindows_79rhkp1fndgsc
  • ii .
  • Go to the properties on the directory: LocalState
  • Uncheck: "Compress contents to save disk space" and "Encrypt contents to secure data"
  • Apply

Then:

  • wsl --set-version Ubuntu-20.04 2
  • wsl --set-default-version 2

Fine-Tuning Skills with PowerShell Modules

 I resumed work on a project to dive deep into Plaster - a tool for auto-generating Modules with custom configurations built-in, instead of having to remember how to create a module each time.

In the past, I had just copied one module and changed the GUID info. It was tedious, but it worked.

This time around, I'm focusing on making it easily repeatable.

Using:

  • Plaster to gen the new module.
  • psake for code build process.
  • Pester tests
  • PlatyPS for dynamic help markdown gen

Fallout 3 (2008) on Windows 10 in 2021

Preface

I'm adding a log of things I'm working on (both professional and fun), as a way to both document experiences and remember what the hell I did. Otherwise, it's lost to the ages just like the very early web cam sessions I did with both of my sons, which were lost to a hard drive failure.

For the last 10 years or so, I had shifted my attention to family & work. I avoided large game titles. Now, it's time to play again.

Fallout 3 : Post Install from Steam in 2021

Just finished Fallout 4, at least to the point of finishing every main quest and last DLC with Nuka-World Open Season. Prior to that Fallout: New Vegas. Wasn't sure if I wanted to try 76 or 3 next. Opted for the latter.

In retrospect, I should have both consulted Reddit, Steam Community and/or Nexus Mods before trying to run the 13 year-old game.
  • https://steamcommunity.com/app/22370/discussions/0/828937546147175081/
  • GFWL Fix: https://www.nexusmods.com/fallout3/mods/22591
  • Intel Fix: https://www.nexusmods.com/fallout3/mods/17209

Important File Paths

  • C:\Program Files (x86)\Steam\steamapps\common\Fallout 3 goty\
    • Fallout_default.ini
  • C:\Users\[USER NAME HERE]\Documents\My Games\Fallout3\
    • Fallout.ini
    • FalloutPrefs.ini

Problem 1: "Ordinal Not found" "Missing C:\Windows\System32\xlive.dll"

Fallout 3 (2008) closely coupled with Windows Live (Gaming for Windows), before Steam. The Fallout 3 installer is indeed bundled with GFWL, but poorly installed. 

Solution

  • Install [Path to Fallout 3 goty]\GFWLive both .msi files

Problem 2: Video crashing to desktop

I'm using a Dell Laptop with both Intel and NVidia chips with a port extender. The loader did not correctly detect the Intel chip and even when adding the game .exe to the NVidia Utility, crashed when trying to play the intro video.

Solution

  • Nexus Mods: Intel HD graphics Bypass package
  • Edit FalloutPrefs.ini to change the "iSize W" and "iSize H" values to match the monitor's resolution.


UPDATE

Had the same problem AGAIN. Full Screen would not display. Ultimately this mod did the trick:
https://www.nexusmods.com/fallout3/mods/21337/?

Thanks!

The Elder Scrolls: Oblivion - 2023 Experience

This article is a WIP.  Setting up Oblivion in 2023 on a Steam Deck (w/ SteamOS)  Install from Steam  Vortex Experience (post base mod tools...