Jeffrey Snover:- “Engineering Encounters with reality”

Who is Jeffrey Snover? Link Jeffrey Snover is a Microsoft Technical Fellow, PowerShell Chief Architect, and the Chief Architect for the Azure Infrastructure and Management group which includes Azure Stack, System Center, and Operations Management Suite.  Snover is the inventor of Windows PowerShell, an object-based distributed automation engine, scripting language, and command-line shell, and was … Continue reading Jeffrey Snover:- “Engineering Encounters with reality”

Powershell – Linux – Invoke Using Command Argument

Background There are a couple of ways to invoke Powershell in Linux. Options Here are a couple of Options:- -File -Command Payload - File Syntax Sample Payload - Command Outline To get username Environment::UserName Syntax Sample Hello World Output Output - Image Output - Text Explanation We printed out our username Environment Variables and $PSVersionTable … Continue reading Powershell – Linux – Invoke Using Command Argument

Install Powershell on Linux/CentOS

Background Back playing around with a Linux box and wanted to see if it is any easier for me to understand the steps for installing Powershell. Outline Configure Source Repositories Review available Microsoft Repository for your OS/Version ( ) Redhat Repository - Local Review "Local" Redhat Repository Is Microsoft repository registered? If Microsoft Repository … Continue reading Install Powershell on Linux/CentOS

Powershell – Error – “The property …. cannot be found on this object. Verify that the property exists.”

Background Playing around with Powershell and ran into an error that one should avoid through defensive programming. Error Error - Image Error - Text Outline We will create a few standalone objects using PSCustomObject Add created objects into an array Iterate through the array Access each object Retrieve property Because our object's properties are created … Continue reading Powershell – Error – “The property …. cannot be found on this object. Verify that the property exists.”

Win OS – Get Domain Information – Using WMI

Background Using WMI, Let us get the short domain name Windows Management Instrumentation (WMI) Script Outline Issue "Get-WmiObject -Class Win32_NTDomain" Capture result of Get-WmiObject in a object Result is actually a list Iterate through the list Each time place list node in an object Here are the important attributes DnsForestName DomainName DomainControllerName DomainControllerAddress Roles Powershell … Continue reading Win OS – Get Domain Information – Using WMI

PowerShell – Network Command – “Test-NetConnection”

Background Continuing with preparing for our planned Network work. Lineage PowerShell – Network Command – "Get-NetAdapter" Link Test-NetConnection Outline The Test-NetCommand provides basic network connection testing over the TCP Protocol. Exercises Exercise - Basic Outline Basic network connectivity test TCP Network Port Test Network Port Number specified as numeric "Common TCP" Port Port Test Diagnostic … Continue reading PowerShell – Network Command – “Test-NetConnection”

PowerShell – Network Command – “Get-NetAdapter”

Background Have a few days of network diagnostic work ahead. And, so let us prepare and go through our requirements worksheet. Get-NetAdapter Outline The Get-NetAdapter command lists the network adapter on our machine. Syntax Sample Output Output-Image Output-Text Explanation I am on a laptop using a wireless connection The key points for me are My … Continue reading PowerShell – Network Command – “Get-NetAdapter”

Powershell – Running Powershell Scripts embedded within folders that have spaces in their name

Background This is a stupid problem to have, but I have it. I created a long folder name that has a space between two words.   PowerShell Script     Error Now when I try to run to run a power script, I get an error message: Syntax:   Error Message:   Textual:     … Continue reading Powershell – Running Powershell Scripts embedded within folders that have spaces in their name

Powershell – Writing out Array Elements

  Background As I went back and started closing out the many Google Chrome Windows and Tabs that I had opened, I took another look at a blog post titled "A Taste of PowerShell - String Manipulation: Splitting and Joining Strings" - .   Introduction The Blog post has a very concise code that was quite … Continue reading Powershell – Writing out Array Elements

Powershell – Parameters (Command Line)

Background Back on this Microsoft Powershell grind.  Need to do a quick script. But, really stumbling.... For instance, I will like to formalize my command line parameters.  Have clean well defined names for them. In most programming languages you end up with dummied-down numbered augment list i.e. %1 %2, etc. But, PowerShell supports named command … Continue reading Powershell – Parameters (Command Line)