Found 212 bookmarks
Newest
The Ultimate PowerShell Profile
The Ultimate PowerShell Profile
Putting the "Power" back into PowerShell with custom functions and aliases 💪
What is a PowerShell profile?A PowerShell profile is a script that runs when PowerShell starts. It's a great way to customize the shell to your liking and to add functionality that doesn't exist out of the box.
The PromptThe first thing I wanted to change was the prompt. The default prompt is a bit boring and doesn't provide much information. I wanted to add some colour and some useful information.I've done this using a third-party module called Oh-My-Posh. This module provides a number of themes and allows you to customize the prompt to your liking. I've chosen the Material theme.
The prompt now shows the current directory, the git branch, and the time.
GitHub IntegrationI use two machines for my day-to-day work. My laptop, and my desktop. I wanted to be able to easily sync my PowerShell profile between the two machines. In order to achieve this, I have included a setup script in the repository. This script will create a symbolic link to the profile in the repository, and place it in the correct location. This allows me to make changes to the profile on either machine and have those changes reflected on the other machine.Within the profile, there is a function that runs each time the profile is loaded. This checks to see if the local git repository is up to date with the remote repository. If it's not, a friendly message is displayed to remind me to pull the latest changes (another function included in the profile).
Support For All Session TypesThe two main interactions I have with PowerShell are through the Windows Terminal and Visual Studio Code. I wanted to ensure that the profile worked in both of these environments.The first hurdle was the font. The material Oh-My-Posh theme requires a font that supports Powerline characters. I chose the Caskaydia Cove Nerd Font. This is not installed by default on Windows, so there is logic in the setup script that installs the font and sets it as the default font in the Windows Terminal.If you look at most documentation for customizing the PowerShell profile, you'll see that it's recommended to use the $PROFILE environment variable. This is a variable that is set by PowerShell and points to the location of the current user's profile script. This works great for the Windows Terminal, but not for Visual Studio Code.
In order to support both environments for a consistent experience, a slightly different (not well-documented) approach is required. You need to use the $PROFILE.CurrentUserAllHosts variable. This variable points to the location of the profile, regardless of the host. This means that the profile will be loaded in both the Windows Terminal, Visual Studio Code, and anywhere else you might use PowerShell on the local machine.
Linux-like AliasesBecause I'm constantly switching between bash and PowerShell, I often get confused about which commands are (and aren't) already aliased. For example, ls is aliased to Get-ChildItem, but there is no equivalent for touch.I've added a number of custom functions to mimic (as closely as possible) the behaviour of their Linux counterparts. For example, grep is now an alias for my custom Find-String function, and df is an alias for the built-in Get-Volume command.My favourite addition is su, which is an alias for Start-AdminSession. This opens a new elevated Windows Terminal window.
function Start-AdminSession { <# .SYNOPSIS Starts a new PowerShell session with elevated rights. Alias: su #> Start-Process wt -Verb runAs }
Secret ManagementWhen writing scripts, it's often necessary to store secrets. These could be passwords, API keys, or other sensitive information. In the past, I've haphazardly stored these in plain text variables. This is obviously not ideal, but it was the easiest way to get the job done.In order to create the lowest barrier to entry, I've created a function called Get-OrCreateSecret. This is a semi-interactive function that will prompt for a secret if it doesn't already exist. Now I only need one line in my scripts to get a secret.
Using the SecretManagement & SecretStore modules, the secret is encrypted and stored in a local vault. This means that the secret is only accessible to the user that created it, on the machine that it was created on. Much better than storing it in plain text!
Further ImprovementsYou'll notice that the repository name is not "PowerShell Profile" and is instead "Windots". Windots is a short form for Windows dotfiles. Dotfiles are a Linux convention for storing configuration files. Though this is not commonplace on Windows, I intend to hack together more centralised configurations for my Windows environments. Hopefully easing the pain of switching between and setting up machines.
·scottmckendry.tech·
The Ultimate PowerShell Profile
Simple, Consistent Package Options
Simple, Consistent Package Options
Simple mechanisms for defining and interpreting package options. Provides helpers for interpreting environment variables, global options, defining default values and more.
·dgkf.github.io·
Simple, Consistent Package Options
How the Internet works
How the Internet works
The Internet has become a critical part of almost every part of our society — it provides information, communication, and entertainment to billions of people every day, and enables coordination and collaboration between people and business across the globe. Unfortunately, this crucial piece of infrastructure is poorly understood by a large majority of the population; the myriad of technologies (both hard and soft) that let your laptop connect to your bank or to your mom’s Skype window could just as well be magic as far as average person in the street is concerned.
·thesquareplanet.com·
How the Internet works
Actuarial Process Optimization—A Case for Using Modern Technology in Actuarial Domain
Actuarial Process Optimization—A Case for Using Modern Technology in Actuarial Domain
Actuarial Process Optimization is a framework for using technology to support the actuary of the future. In this article, we discuss the capabilities of new technologies and explore examples where they can be used to aid with providing strategic business direction, optimizing skillsets and use of technology, and maintaining governance, control, and risk frameworks.
Innovation in technology has disrupted nearly every industry creating mounting internal and external pressures on organizations to accelerate the adoption of their digital agendas. The COVID-19 pandemic further brought to light the need for technology to be adaptable, powerful, and scalable. Insurance companies have been trying to keep up with the pace of innovation, primarily focusing on adopting modern technology on the consumer experience front.
Many have modernized the front office processes that support application, underwriting, and claim handling. The significant benefits achieved through process optimization and the use of modern technology have been the topic of discussions at many insurance conferences and publications.
As the insurance industry leaps into the future, actuaries must not only proactively refine their roles and responsibilities within insurance companies, but also seek opportunities for improvements and optimization in their day-to-day work. This article will focus on how technology and actuarial process optimization will support the role of the future actuary as a leader, risk manager, and technologist.
Opportunities for APO
Actuaries are valuable and strategically important resources to insurance companies. We are trained both on the job and through an intensive education and exam curriculum to study and own insurance risk. As highly capable professionals, actuaries are often self-reliant, and are interested in owning all technology tools, data and processes that support their daily jobs. However, this hands-on approach can lead to performing many tasks that do not require actuarial expertise. By occupying ourselves with various high effort but low value tasks, we often neglect to focus on higher value tasks that are truly valuable to the future of our organization. Advancements in technology and the desire for lean operations have contributed to many insurers evaluating their strategic direction and the role of the actuary of the future, shifting their focus onto highest value tasks.
Unnecessarily complex and error prone ETL, production and reporting workflows. Time and resources wasted on resolving errors and tracing back complex process steps. Production and process errors that can result in misstatements and delays in reporting. Multiple unvalidated spreadsheets with overlapping functionalities. Multiple sources of information, but no single “source of truth.” Storage and processing time wastage.
·soa.org·
Actuarial Process Optimization—A Case for Using Modern Technology in Actuarial Domain
Data Modeling - Relational Databases (SQL) vs Data Lake (File Based) - Confessions of a Data Guy
Data Modeling - Relational Databases (SQL) vs Data Lake (File Based) - Confessions of a Data Guy
Data Modeling is a topic that never goes away. Sometimes I do reminisce about the good ol’ days of Kimball-style data models, it was so simple, straightforward, just the same thing for years. Then Big Data happened, Spark happened. Things just changed. There is a lot of new content coming out around Data Lakes and […]
·confessionsofadataguy.com·
Data Modeling - Relational Databases (SQL) vs Data Lake (File Based) - Confessions of a Data Guy
Why Every Entrepreneur Should Be Doing A Weekly Review
Why Every Entrepreneur Should Be Doing A Weekly Review
Ever get the feeling nagging at the back of your head that there’s something you’re supposed to do, but you can't remember what it is? Or you know you're supposed to ask something specific to the person you're talking to? Or you've got so many open loops in that you aren't sure what the logical next step is? I used to. I don't very much anymore. I've always been a bit of the absent minded professor type, prone to getting lost in my head or on a walk. That means that I've always had a problem losing or forgetting things that need to get taken care of.
·taylorpearson.me·
Why Every Entrepreneur Should Be Doing A Weekly Review
Have we got NEWS.md for you
Have we got NEWS.md for you
When developing a package it is essential to track the changes you make to your code. This is especially vital if they are breaking changes which have implications for any code written that depends on your package, i.e. a major version bump. Although you can always look back at your version control history in git, it is also convenient to have documentation which summarises the changes. This is where the NEWS file comes in.
·jumpingrivers.com·
Have we got NEWS.md for you