PowerShell The Basics ( for me anyway )

PowerShell The Basics ( Profiles )

If you use one of the search engines now available you’ll find tons of information containing videos and blogs on what PowerShell is and explanations showing how to use it.  Simply put it could be any one of these things

  • What is PowerShell?
  • PowerShell Cmdlets
  • PowerShell Snapins
  • PowerShell Modules
  • PowerShell Remoting
  • Navigating in PowerShell
  • PowerShell Profiles

These are a  few things that I like to do when setting up PowerShell on my machine and machines in the environments where I typically work.  Providing that you have access to machines in your domain and the role you have can limit some processes within PowerShell. For example you might not have AD (Active Directory) access to review users or computer roles. But, if access is granted PowerShell can be of value.

Most people and especially system admins  have tools and scripts they like or have developed for researching files and folders, reading event logs and countless other uses.  Scripting tools like PowerShell can assist with and automate day to day processing and as an added bonus you don’t have to install executable programs in data centers or on production machines.

PowerShell comes to the aid allowing you to place common and often used scripts into modules that can be distributed to others and if placed into your profile, will be available each time you start a PowerShell session.

PowerShell Profile.

PowerShell essentially runs a script as the new session is started.  If the script is empty you get default PowerShell window. If you have a custom profile with custom modules and scripts those will run.*.ps1 Profiles can contain many useful functions.

PowerShell profile locations.

Show all profile names available

$PROFILE | Get-Member -MemberType noteproperty | select name

Show all profiles along with path

$PROFILE | Select-Object -Property *
AllUsersAllHosts :
AllUsersCurrentHost :
CurrentUserAllHosts :
CurrentUserCurrentHost :
Length :

$Profile Standard default C:\YourLocation\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1

Editing a profile is as simple as entering NOTEPAD $profile or which profile to edit could be NOTEPAD $Profile.AllUsersAllHosts.  etc..  As mentioned if no profile exists a nice popup allows you to create/save profile that you’re editing.noprofile

As you see profiles are nothing more then PowerShell scripts running for the duration of your session.

A profile can be as simple or complex as you’d like

function Edit-ProfileFile
Notepad $profile

Set-Alias -Name ep -value Edit-ProfileFile -Scope Global

Remember to set the windows PowerShell script execution policy to one of the following values: Restricted, AllSigned, RemoteSigned or Unrestricted.

I will be posting all profile code that I use on github as time permits.



Categories: #PowerShell, PowerShell Posts, Technology

Tags: , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Loly Hallison

"In moments of crisis, only the imagination is more important than the knowledge" Albert Einstein

The Art of Blogging

For bloggers who aspire to inspire

creative art ✏ design that inspires😊


Journeying Through My Thoughts

♡|Thoughts|Beautiful Words|Motivation|Poem's|Quote's|Maybe Short Storie's|Happiness|Joy|Soul Pouring|An Escape Patch|Memories|Home|♡

Manić Teodora

Al cielo.. e niente di meno!🌈

Voices on a paper

I often eavesdrop to random voices roaming in the air. Some leave bruises on my eyelids due to the frequent wiping of tears. They have a saddening picture. Others stimulate endless smiles. Some would like to remain unidentified. All in all, I love to narrate stories of the sad, happy and mysterious voices.


Poem and motivational stories

Syra and her Partner's in Crime

Everything that adds up to your fashion trends ♥

%d bloggers like this: