Browse by Tags

Tagged Content List
  • Blog Post: Useful DateTime functions - LibraryTime.ps1

    I was going to post a blog entries and realized that the example I wanted to give used some of my utility functions so I'll share them first. I hope you find them interesting. I put them in a file called LibraryTime.ps1 and dot source that during my login. BTW - everyone should adopt that pattern. Files...
  • Blog Post: The Wonders of Date Math using Windows PowerShell

    Larry Hayden posted a query about dates at: http://techtasks.com/bookmarks/powershell/2006/09/interview-with-a-scripter-jeffrey-snover/ He has a script which gets all the Application Events that happened TODAY: ———————————————————— $today = [DateTime]::Today $Events = Get-Eventlog -New 1024 Application...
  • Blog Post: Writing and Reading info from Serial Ports

    PSMDTAG:FAQ: How do I read/write data from a Serial Port? Writing to a Serial Port PS> [System.IO.Ports.SerialPort]::getportnames() COM3 PS> $port= new-Object System.IO.Ports.SerialPort COM3,9600,None,8,one PS> $port.open() PS> $port.WriteLine("Hello world") PS> $port.Close() Reading...
  • Blog Post: Casting a scriptblock to an arbitrary delegate signature

    Arild asked the following in http://arildf.spaces.msn.com/blog/cns!E99F8B43533149B0!140.entry?_c%3dBlogPart : PSMDTAG:FAQ: Delegates - how to cast a scriptblock to an arbitrary delegate signature? ANSWER - You can't in V1.0. In version 1.0 Windows PowerShell only supports casting scriptblocks to...
  • Blog Post: Cascading Type Casts

    A user on the newsgroup wondered whether the example below highlighted a bug or a feature. They applied multiple type declarations on a single parameter and Windows PowerShell did not complain. function check { param([string] [int] $y = 0, $x = 0) ###^^^^^^^^^^^^ $x.GetType().ToString(); $y.GetType...
  • Blog Post: Type Shortcuts

    PSMDTAG:FAQ: What is a TYPE SHORTCUT? PSMDTAG:FAQ: What are the TYPE SHORTCUTS? Type shortcuts are a Windows PowerShell feature that allows you to reduce the amount of typing you have to do when specifying a type. For example, the following 2 statements produce the same result: [System...
  • Blog Post: Using Format Control Strings.

    PSMDTAG:FAQ: How do I display large numbers with commas? PSMDTAG:FAQ: How do I use .NET formatting strings? As scripters, we often spend tons of times trying to get our data formated just the right way. Often this is an error-prone, frustrating experience. Windows PowerShell leverages .NET objects...
  • Blog Post: Exposing the Power of .NET in a Admin-friendly way

    One of our primary goals for Monad was to: "Expose the power of .NET in an Admin-friendly way" . The challenges of systems administration are large and growing at the same time organizations are under ever more pressure to reduce costs and do more with less. That was true 10 years ago, it is true...
  • Blog Post: Base64 Encode/Decode a string

    Today I came across http://scripts.readify.net/ . This sight is focused on Monad and MSH and is starting a collection of scripts at: http://scripts.readify.net/Scripts.aspx . You should visit their site and let them know what type of scripts would be useful to you. I particularly liked their entry...
  • Blog Post: Sunday morning drive with my hair on fire: Types/Community/Synthetic types/Democracy/Cool XML tricks

    Exploring types is a pain! Monad provides Get-Member which makes it pretty nice to explore an OBJECT but if you want to explore that object's type, you have to use the capabilities of the System.RuntimeType class. Let me make that distinction a little clearer. Imagine that I've got some xml: $x...
  • Blog Post: Comparative Examples in MSH and KSH

    M ost shells (such as Windows CMD.EXE and the UNIX shells SH, KSH, CSH, and BASH) operate by executing a command or utility in a new process, and presenting the results (or errors) to the user as text. Text-based processing is the way in which system interaction is done with these shells. Over the years...
Page 1 of 1 (11 items)