Skip to content
Menu
The Lonely Administrator
  • PowerShell Tips & Tricks
  • Books & Training
  • Essential PowerShell Learning Resources
  • Privacy Policy
  • About Me
The Lonely Administrator

Category: Scripting

More Fun with Get-Content

Posted on February 15, 2007July 2, 2013

A few followups on my recent post about Get-Content. First, you can also use the CAT alias if you’re used to the Unix world, or TYPE in place of get-content. The Get-Content cmdlet does have a parameter called -totalcount that will return the specified number of lines from the beginning of the file: cat c:\boot.ini…

Share this:

  • Share on X (Opens in new window) X
  • Share on Facebook (Opens in new window) Facebook
  • Share on Mastodon (Opens in new window) Mastodon
  • Share on LinkedIn (Opens in new window) LinkedIn
  • Share on Reddit (Opens in new window) Reddit
  • Print (Opens in new window) Print
  • Email a link to a friend (Opens in new window) Email

Like this:

Like Loading…
Read More

PowerShell Get Content

Posted on February 13, 2007July 2, 2013

One slick trick you can do in PowerShell with text files that’s difficult to accomplish without extra tools is to display sections of text files without showing the entire file. When you use the Get-Content cmdlet, the resulting content is treated as an array of strings. This means you can simply specify the line you…

Share this:

  • Share on X (Opens in new window) X
  • Share on Facebook (Opens in new window) Facebook
  • Share on Mastodon (Opens in new window) Mastodon
  • Share on LinkedIn (Opens in new window) LinkedIn
  • Share on Reddit (Opens in new window) Reddit
  • Print (Opens in new window) Print
  • Email a link to a friend (Opens in new window) Email

Like this:

Like Loading…
Read More

Save on Advanced VBScript

Posted on January 31, 2007July 2, 2013

Bookpool is having a huge sale on Microsoft Press books, up to 50% off. If you’ve been putting off getting a copy of Advanced VBScript for Microsoft Windows Administrators, it probably won’t get better than this. Bookpool has this title at 45% off. Plus I think they are offering free shipping on orders over $40….

Share this:

  • Share on X (Opens in new window) X
  • Share on Facebook (Opens in new window) Facebook
  • Share on Mastodon (Opens in new window) Mastodon
  • Share on LinkedIn (Opens in new window) LinkedIn
  • Share on Reddit (Opens in new window) Reddit
  • Print (Opens in new window) Print
  • Email a link to a friend (Opens in new window) Email

Like this:

Like Loading…
Read More

Updated Logon Script Generator

Posted on January 28, 2007July 2, 2013

Last fall I demonstrated an HTA I had developed to rapidly develop a user logon script with practically no scripting. You could map drives and printers based on group membership simply be selecting a group from a pre-populated drop down list. You could display a message to the user with information just as a summary…

Share this:

  • Share on X (Opens in new window) X
  • Share on Facebook (Opens in new window) Facebook
  • Share on Mastodon (Opens in new window) Mastodon
  • Share on LinkedIn (Opens in new window) LinkedIn
  • Share on Reddit (Opens in new window) Reddit
  • Print (Opens in new window) Print
  • Email a link to a friend (Opens in new window) Email

Like this:

Like Loading…
Read More

PowerShell DBA

Posted on January 26, 2007August 5, 2009

There is a very nice review of the new Powershell book at : http://weblog.infoworld.com/dbunderground/archives/2007/01/rtfm.html. I’m glad he likes the book, even though he doesn’t know who I am. But I’m working on it!! Anyway, the interesting point in his review is that he is looking at PowerShell from the perspective of a SQL DBA. In…

Share this:

  • Share on X (Opens in new window) X
  • Share on Facebook (Opens in new window) Facebook
  • Share on Mastodon (Opens in new window) Mastodon
  • Share on LinkedIn (Opens in new window) LinkedIn
  • Share on Reddit (Opens in new window) Reddit
  • Print (Opens in new window) Print
  • Email a link to a friend (Opens in new window) Email

Like this:

Like Loading…
Read More

Windows PowerShell: TFM Out of stock

Posted on January 23, 2007July 2, 2013

Amazon is again showing that Windows PowerShell: TFM is unavailable. Apparently they sold out of the initial order of books. Last I knew, SAPIEN Press was waiting for Amazon to place a re-order. Given the time it takes to ship books it could be a bit before Amazon gets re-stocked. If you can’t wait, remember…

Share this:

  • Share on X (Opens in new window) X
  • Share on Facebook (Opens in new window) Facebook
  • Share on Mastodon (Opens in new window) Mastodon
  • Share on LinkedIn (Opens in new window) LinkedIn
  • Share on Reddit (Opens in new window) Reddit
  • Print (Opens in new window) Print
  • Email a link to a friend (Opens in new window) Email

Like this:

Like Loading…
Read More

Scripting Makeover Contest

Posted on January 22, 2007July 2, 2013

SAPIEN Technologies is pulling out all the stops to put Windows automation at the top of everyone’s to do list. Or at least on the radar screen of the people watching the bottom line. They are running a Scripting Makeover Contest with very serious prizes. Here’s the official announcement which some of you may not…

Share this:

  • Share on X (Opens in new window) X
  • Share on Facebook (Opens in new window) Facebook
  • Share on Mastodon (Opens in new window) Mastodon
  • Share on LinkedIn (Opens in new window) LinkedIn
  • Share on Reddit (Opens in new window) Reddit
  • Print (Opens in new window) Print
  • Email a link to a friend (Opens in new window) Email

Like this:

Like Loading…
Read More

Windows PowerShell: TFM Sample Scripts

Posted on January 17, 2007July 2, 2013

If you have a copy of Windows PowerShell:TFM, you may want to get the sample scripts to test out. You can download a zip file of all the sample scripts from the book page at SAPIEN Press. Just scroll to the bottom of the page. You’ll also find a link to errata information. The book…

Share this:

  • Share on X (Opens in new window) X
  • Share on Facebook (Opens in new window) Facebook
  • Share on Mastodon (Opens in new window) Mastodon
  • Share on LinkedIn (Opens in new window) LinkedIn
  • Share on Reddit (Opens in new window) Reddit
  • Print (Opens in new window) Print
  • Email a link to a friend (Opens in new window) Email

Like this:

Like Loading…
Read More

Powershell Parsing

Posted on January 16, 2007August 5, 2009

In PowerShell, Get-WMIObject is a terrific cmdlet for remotely managing systems. If you have a text list of server or computer names, here’s a quick method you could enumerate that list and do something to each server. foreach ($server in (Get-Content s:\servers.txt)) {#skip blank lines if (($server).length -gt 0) { $server Get-WmiObject win32_operatingsystem -computer $server.Trim()}…

Share this:

  • Share on X (Opens in new window) X
  • Share on Facebook (Opens in new window) Facebook
  • Share on Mastodon (Opens in new window) Mastodon
  • Share on LinkedIn (Opens in new window) LinkedIn
  • Share on Reddit (Opens in new window) Reddit
  • Print (Opens in new window) Print
  • Email a link to a friend (Opens in new window) Email

Like this:

Like Loading…
Read More

Powershell Help Examples

Posted on January 15, 2007August 5, 2009

It may seem like a little thing, but the Get-Help cmdlet in PowerShell has some features you may not be aware of. I’m always using the -full parameter to see all the help information, primarily so I can see the examples. Well Get-Help has a -examples switch which won’t display syntax help, but it will…

Share this:

  • Share on X (Opens in new window) X
  • Share on Facebook (Opens in new window) Facebook
  • Share on Mastodon (Opens in new window) Mastodon
  • Share on LinkedIn (Opens in new window) LinkedIn
  • Share on Reddit (Opens in new window) Reddit
  • Print (Opens in new window) Print
  • Email a link to a friend (Opens in new window) Email

Like this:

Like Loading…
Read More

Techmentor 2007 Orlando

Posted on January 2, 2007July 2, 2013

Once again, I will be presenting at Techmentor in Orlando March 26-30. I’ll be doing sessions on ADSI, Batch files, PowerShell, and more. If you’ve never been, it’s a great time to get out of the office and learn a ton of real-world material that you can take back to the shop and put immediately…

Share this:

  • Share on X (Opens in new window) X
  • Share on Facebook (Opens in new window) Facebook
  • Share on Mastodon (Opens in new window) Mastodon
  • Share on LinkedIn (Opens in new window) LinkedIn
  • Share on Reddit (Opens in new window) Reddit
  • Print (Opens in new window) Print
  • Email a link to a friend (Opens in new window) Email

Like this:

Like Loading…
Read More

Dec 31 Madness

Posted on December 21, 2006July 2, 2013

ScriptingOutpost.com is having an end of the year madness sale on Dec. 31, 2006. All day December 31st, you’ll be able to save over $100 (30%!) on SAPIEN’s PowerShell Essentials Package. The package consists of: PrimalScript 4.1 Professional, Windows PowerShell: TFM, and the new Windows PowerShell Snippets Pack. Technorati Tags:PowerShell Scripting

Share this:

  • Share on X (Opens in new window) X
  • Share on Facebook (Opens in new window) Facebook
  • Share on Mastodon (Opens in new window) Mastodon
  • Share on LinkedIn (Opens in new window) LinkedIn
  • Share on Reddit (Opens in new window) Reddit
  • Print (Opens in new window) Print
  • Email a link to a friend (Opens in new window) Email

Like this:

Like Loading…
Read More

Files on a diet

Posted on December 20, 2006August 5, 2009

I did a MCPMag.com TipSheet column recently on compacting files to save space. I thought I’d take a moment to respond to some of the comments. First, today’s hard drives are enormous and drives are cheap. However, there are still plenty of 3 and 5 year old servers that need to squeak by for a…

Share this:

  • Share on X (Opens in new window) X
  • Share on Facebook (Opens in new window) Facebook
  • Share on Mastodon (Opens in new window) Mastodon
  • Share on LinkedIn (Opens in new window) LinkedIn
  • Share on Reddit (Opens in new window) Reddit
  • Print (Opens in new window) Print
  • Email a link to a friend (Opens in new window) Email

Like this:

Like Loading…
Read More

Speak to me

Posted on November 22, 2006August 5, 2009

Who says scripting is dull and boring?!? Set objSPVoice=CreateObject(“SAPI.SpVoice”)objSPVoice.Speak “I want to rock and roll all night, and party every day!” Technorati Tags:Scripting

Share this:

  • Share on X (Opens in new window) X
  • Share on Facebook (Opens in new window) Facebook
  • Share on Mastodon (Opens in new window) Mastodon
  • Share on LinkedIn (Opens in new window) LinkedIn
  • Share on Reddit (Opens in new window) Reddit
  • Print (Opens in new window) Print
  • Email a link to a friend (Opens in new window) Email

Like this:

Like Loading…
Read More

Batch File Logs

Posted on November 22, 2006August 5, 2009

I’ve always liked creating audit logs in my VBScript work, but could never figure out how to create a nicely formatted log from a batch file. Now I have. See http://sapien.eponym.com/blog/_archives/2006/11/20/2513469.html for the details. Technorati Tags:Batch Scripting

Share this:

  • Share on X (Opens in new window) X
  • Share on Facebook (Opens in new window) Facebook
  • Share on Mastodon (Opens in new window) Mastodon
  • Share on LinkedIn (Opens in new window) LinkedIn
  • Share on Reddit (Opens in new window) Reddit
  • Print (Opens in new window) Print
  • Email a link to a friend (Opens in new window) Email

Like this:

Like Loading…
Read More
  • Previous
  • 1
  • …
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • Next
reports

Powered by Buttondown.

Join me on Mastodon

The PowerShell Practice Primer
Learn PowerShell in a Month of Lunches Fourth edition


Get More PowerShell Books

Other Online Content

github



PluralSightAuthor

Active Directory ADSI Automation Backup Books CIM CLI conferences console Friday Fun FridayFun Function functions Get-WMIObject GitHub hashtable HTML Hyper-V Iron Scripter ISE Measure-Object module modules MrRoboto new-object objects Out-Gridview Pipeline PowerShell PowerShell ISE Profile prompt Registry Regular Expressions remoting SAPIEN ScriptBlock Scripting Techmentor Training VBScript WMI WPF Write-Host xml

©2026 The Lonely Administrator | Powered by SuperbThemes!
%d