Articles tagged Powershell

04 December 2015
04 December 2015

The PoSh DBA – Using the Basic PowerShell Paradigms

PowerShell is like any computer language: you must understand the paradigms, the constructs, and the way it is designed to work to get the most value from it. It is no good just translating 'sausage-string' procedural algorithms. To demonstrate how PowerShell should be used as its' creators intended, Laerte Junior shows the difference between PowerShell problem-solving with, and without, PowerShell paradigms.… Read more
01 December 2015
01 December 2015

PowerShell Day-to-Day SysAdmin Tasks: Securing Scripts

Although PowerShell is popular, for malicious intruders it represents a very attractive attack vector into your system. The obvious way of preventing this type of penetration is to detect when a script is altered. Not only must any script that is used for system or data administration be properly secured, but also any script that is used to maintain a PowerShell profile.… Read more
17 November 2015
17 November 2015

Documenting Your PowerShell Binary Cmdlets

0
8
Whereas it is easy to provide inline documentation for a normal scripted PowerShell cmdlet or function so as  to provide comprehensive help at the command-line or IDE, the same isn't true of binary cmdlets written in C#. At last, there is an open-source utility to assist with this that is being actively maintained and updated. At last, binary cmdlets need no longer be the poor cousins of scripted cmdlets in their documentation… Read more
16 November 2015
16 November 2015

Doing a SQL Server Healthcheck via PowerShell

PowerShell is an ideal tool for doing health checks of a collection of SQL Server instances, and there are several examples around, but few acknowledge the fact that individual DBAs have their own priorities for tests, and need something easily changed to suit circumstances. Omid's health check allows tests to be SQL or PowerShell and requires only adding, altering or deleting files in directories. … Read more
22 October 2015
22 October 2015

Ins and Outs of the PowerShell Pipeline

For many developers, understanding pipelining in PowerShell is like understanding reductive physicalism: you think you've just about got it, and then the brain blue-screens. Michael Sorens is inspired by his several efforts to explain pipelining on StackOverflow to attempt the definitive simple explanation for the rest of us.… Read more
21 October 2015
21 October 2015

Automating Your SQL Server Best Practice Reports: The Document

If you're making a report from table-based data, an MS Word document is often a good option. In the second part of his introduction to SQL Server best-practice monitoring, Laerte Junior shows how to use PowerShell scripts to create a Word-based report with colour-coded alerts where there are problems or best practices aren't being followed.… Read more
06 October 2015
06 October 2015

Automating Your SQL Server Best Practice Reports:The Checks

A DBA in charge of a whole lot of databases and servers has to check regularly that there are no likelihood of problems. The task is well suited for automation as workload increases. Laerte Junior introduces a PowerShell-based reporting framework that aims to simply provide a Word-based report with colour-coded alerts where there are problems or best practices aren't being followed.… Read more
14 September 2015
14 September 2015

Build Your Own Resource Monitor in a Jiffy

It's great to be able to monitor a counter or any other changing metric while engaged in development work. You'd think that the two alternatives would be using a third-party tool or hacking a PowerShell script. Well no, because there could be an existing open-source PowerShell module that would do it for you, and with a little customization could give you precisely what you need.… Read more
09 September 2015
09 September 2015

Writing Build vNext tasks for Visual Studio Online

Hosted TFS, now called Visual Studio Online (VSO), has a new way of writing build processes called Build vNext. Agent tasks are the building blocks of processes and you can supplement the built-in ones with custom build tasks defined in JSON that use targets written in node.js or PowerShell. Jason Crease shows how to develop custom build tasks for building, testing, publishing and synchronizing databases.… Read more
12 August 2015
12 August 2015

When to Quote in PowerShell

The one question about PowerShell that trips up almost everyone is about when and how to quote strings. Because PowerShell replaces the old command shell, it has to be able to work the way that it did with string parameters, but it also has to behave like a .NET scripting language to replace VBA. PowerShell grapples with this apparent contradiction, and manages to square the circle. Michael Sorens explains the how and when of PowerShell quoting.… Read more
01 July 2015
01 July 2015

PowerShell Day-to-Day Admin Tasks: Monitoring Performance

By reading performance counters from services such as SQL Server or Exchange, you can get a wealth of performance information. By automating the process of gathering and storing appropriate counters, you can routinely check a range of devices quickly using visual tools such as PerfMon. By then creating your own counters, you can add counter-based metrics to anything that can be measured programmatically, such as services, applications, processes such as ETL, or deployments. … Read more
25 June 2015
25 June 2015

The Poster of the Plethora of PowerShell Pitfalls

One of the downsides of learning a new computer language is that transfer of training doesn't always work to your advantage. In fact, the habits you picked up in the past may now cause confusion. In this poster or wall-chart for long walls, Michael Sorens selects the thirty-six most common causes of confusion for anyone getting to grips with PowerShell. Forewarned is forearmed.… Read more
28 May 2015
28 May 2015

PowerShell Day-to-Day Admin Tasks: WMI, CIM and PSWA

WMI (Windows Management Instrumentation) is the basic way of querying and changing basic information about any windows server, including SQL Server or Exchange Server. It provides a logical structure and representation of systems and services that are hosted on the server and is essential for anyone who is keen to automate routine monitoring and administration work via PowerShell, especially where many servers are involved in the task.… Read more
02 April 2015
02 April 2015

A Plethora of PowerShell Pitfalls

PowerShell has some very valuable features, but it is a mistake to believe that all those skills that you've derived from more conventional programming languages will transfer over to PowerShell. There are some pitfalls for the unwary. Michael Sorens warns abut the most common PowerShell pitfalls and explains how to avoid them.… Read more
16 January 2015
16 January 2015

A Start with Automating Database Configuration Management

For a number of reasons, it pays to have the up-to-date source of all the databases and servers that you're responsible for in a central archive, in version control, and this is a job that is best automated. If you enlist the help of SQL Compare Pro, you can create a Powershell-based system that can be extended to warn you of changes, roughly when they happened, with a report of exactly what changed and how.… Read more