Creating PowerShell Functions Dynamically

Creating PowerShell Functions Dynamically

New-Item can create new things on any PowerShell drive, including the function: drive that holds all PowerShell functions. Defining Dynamic Functions in PowerShell If you’d like, you can define new functions dynamically inside your code. These new functions would then...

Creating PowerShell Functions Dynamically

Identifying Windows Type

WMI returns a cryptic code number of every distinct Windows SKU: PS> Get-CimInstance -ClassName Win32_OperatingSystem | Select-Object -ExpandProperty OperatingSystemSKU 48 How to Translate Windows SKU Codes into Meaningful Text To translate this number into a...

Add SQL Server Instances to SQL Diagnostic Manager

Add SQL Server Instances to SQL Diagnostic Manager

With SQL Diagnostic Manager, monitor the performance of the entire SQL Server environment by quickly and easily adding SQL Server instances. There are two different ways to add instances of SQL Server to SQL Diagnostic Manager. First, you can add instances with the...

Creating PowerShell Functions Dynamically

Launching PowerShell Scripts Invisibly

There is no a built-in way to launch a PowerShell script hidden: even if you run powershell.exe and specify -WindowStyle Hidden, the PowerShell console will still be visible for a fraction of a second. To launch PowerShell scripts hidden, you can use a VBScript,...

Creating PowerShell Functions Dynamically

Get-ComputerInfo vs. systeminfo.exe (Part 1)

For a long time, the command-line utility systeminfo.exe provides a wealth of information about a computer and can return object-oriented results with a little trick: $objects = systeminfo.exe /FO CSV | ConvertFrom-Csv $objects.'Available Physical Memory' Advantages...

Creating PowerShell Functions Dynamically

Installing the SQLDM CWF dashboard during a trial

In this blog post, I'll be guiding you through the installation of the SQL Diagnostic Manager and the IDERA Dashboard in a trial environment. In the steps below, I'll use the default directories. Just something to keep in mind as you perform the...

Creating PowerShell Functions Dynamically

Simple PowerShell Chat

Creating a Simple Multi-Channel Chat Room with PowerShell Here’s a fun PowerShell script that you can use to create a simple multi-channel chat room. All you need is a network share where everyone has read and write permissions. The chat is file-based and makes use of...

Creating PowerShell Functions Dynamically

Converting SecureString to Text

It can be very useful to be able to convert an encrypted SecureString back to a plain text. This way, for example, you can use PowerShell’s “masked input” features. Simply ask for a SecureString, and PowerShell takes care of masking the user input. Next, take the...

Creating PowerShell Functions Dynamically

Using Awesome Export-Excel Cmdlet (Part 5)

This is part 5 of our mini-series about the awesome and free “ImportExcel” PowerShell module by Doug Finke. Make sure you install the module before you play with this tip: PS> Install-Module -Name ImportExcel -Scope CurrentUser -Force Recap from Part 4: Displaying...

Creating PowerShell Functions Dynamically

Converting HTTP Response Codes

Checking Website Availability with a PowerShell Function In the previous example we created a small PowerShell function that checks web site availability, and as part of the test results, a HTTP response code was returned. Let’s check out how this numeric code can be...

Creating PowerShell Functions Dynamically

Finding Hidden PowerShell Applications

The most widely known PowerShell hosts are certainly powershell.exe and powershell_ise.exe because they ship out-of-the-box. However, there can be many more (and hidden) PowerShell hosts running. Any software that instantiates the PowerShell engine is a PowerShell...

Creating PowerShell Functions Dynamically

Using Pop-up Dialogs that Are Always Visible

In the previous tip we used an old COM technique to display a pop-up box with a built-in timeout. That worked pretty well except that the dialog box can be covered under your PowerShell window at times. Keep PowerShell Dialog Boxes Always on Top With a little-known...

Creating PowerShell Functions Dynamically

Using Session Variables in Web Requests

Why Some Web Requests Fail in PowerShell but Work in a Browser Sometimes, web requests that work fine in a browser do not seem to work well in PowerShell. For example, when you navigate to http://www.geocode.xyz/Bahnhofstrasse,Hannover?json=1 in a browser, you get...

Cloud Building Blocks and Layers

Cloud Building Blocks and Layers

Welcome back to our blog series, Solutions for the Cloud. Now that we’ve discussed three concepts of virtualization related to the cloud, we will cover the basics of cloud infrastructure including cloud building blocks and layers. The Two Building Blocks of Cloud...

How-To: Configuring Your RAD Server Instance

How-To: Configuring Your RAD Server Instance

This guide is a full reference for configuring your RAD Server instance. It was written by Eli M. and is part of the collection of New RAD Server (EMS) Articles, Resources, and eBook. How-To: Configuring Your RAD Server Instance RAD Server is a turn-key application...

Creating PowerShell Functions Dynamically

Using FileSystemWatcher Asynchronously

In the previous tip we looked at the FileSystemWatcher object and how it can monitor folders for changes. To not miss any changes, however, an asynchronous approach is required which looks like this: $FileSystemWatcher = New-Object System.IO.FileSystemWatcher...

RAD Server: Returning JSON with TJSONValue & More

RAD Server: Returning JSON with TJSONValue & More

[See the full index of articles for more information] RAD Server provides support for handling JSON data that can be consumed by different programming languages and tools. Creating a JSON string,transmitting the string as a response, and having client application code...

Creating PowerShell Functions Dynamically

Finding PowerShell Named Pipes

Each PowerShell host running PowerShell 5 or better opens a “named pipe” that you can detect. The code below identifies these named pipes and returns the processes exposing the pipes: Get-ChildItem -Path "\\.\pipe\" -Filter '*pshost*' | ForEach-Object { Get-Process...

1 5 6 7 8 9 16