Welcome to MSDN Blogs Sign in | Join | Help

Browse by Tags

All Tags » FAQ   (RSS)

Installing PowerShell on Vista/"Longhorn" Server

1. I am new to PowerShell and would like to install it on my Vista machine. The following page http://www.microsoft.com/windowsserver2003/technologies/management/powershell/download.mspx gives you links to various PowerShell downloads. Choose the one

Windows PowerShell Exit Codes

Windows PowerShell Exit Codes PSMDTAG:FAQ: How can my script control the PowerShell exit code? Answers: 1. A normal termination will set the exitcode to 0 2. An uncaught THROW will set the exitcode to 1 3. The EXIT statement will stop the process and
Posted by PowerShellTeam | 5 Comments
Filed under:

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
Posted by PowerShellTeam | 3 Comments
Filed under: ,

DateTime Utility Functions

I often want to find things that happened Today. For instance, which files got changed today. Windows PowerShell makes this easy to do but it can be a bit verbose and I do it a lot so I've added a function to my profile: IsToday. function isToday ([datetime]$date)
Posted by PowerShellTeam | 6 Comments
Filed under: ,

BizTalk Server Applications: Get/Start/Stop

Tomas Restrepo has a nice script for getting/starting/stoping BizTalk Server Applications at: ht tp://www.winterdom.com/weblog/2006/09/02/BTSResetWithPowerShell.aspx I like how readable it the script is. It is completely obvious what is going on. Compare
Posted by PowerShellTeam | 1 Comments
Filed under: ,

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.Write("Hello
Posted by PowerShellTeam | 2 Comments
Filed under: ,

Background "jobs" and PowerShell

A lot of people have asked whegther Windows PowerShell can do UNIX job handling. The paraphrase an old management salesperson joke, "YES - YOU can do UNIX job handling with Windows PowerShell" (which means you have to do it yourself). Jim Truher shows
Posted by PowerShellTeam | 2 Comments
Filed under:

More Windows PowerShell Training Available

Don Jones, of ScriptingAnswers.com, is holding two two-day classes on Windows administrative scripting in Chicago and Seattle this September. While the first day of each class will focus on advanced VBScript techniques, the second day will be entirely
Posted by PowerShellTeam | 0 Comments
Filed under:

Windows PowerShell and the “PowerShell Worm”

Full Article is here: http://blogs.msdn.com/powershell/archive/2006/08/03/687838.aspx A “PowerShell Worm” has recently been reported by several antivirus companies and some news organizations. There has been some confusion and concern around the classification of this malicious script as a worm as well as questions about the risk. It is important to note that the PowerShell Worm will not work and cannot infect Windows PowerShell in its default configuration. This is a proof-of-concept virus whose “Worm” replication mode is just a simple file copy and could have been implemented in any language which supports copying files. The fact that the worm is written in PowerShell rather than another scripting language or even as an executable has actually made it even harder for this virus to spread since the additional security features around PowerShell scripts result in many additional steps for the user to perform before an infection can take place.
Posted by PowerShellTeam | 11 Comments
Filed under: ,

Joel-On-Software on the power of a good language

Joel Spolsky of Joel-On-Software fame, just posted a blog, "Can Your Programming Language Do This?" http://www.joelonsoftware.com/items/2006/08/01.html In this article, he drives home the point that when it comes to code: Maintainability, Readability,
Posted by PowerShellTeam | 11 Comments
Filed under: ,

ScriptCenter EventLog Article

ScriptCenter has a very good article exploring the use of Windows PowerShell to analyze your eventlogs. Check it out at: http://www.microsoft.com/technet/scriptcenter/topics/msh/cmdlets/get-eventlog.mspx PSMDTAG:CMDLET: Get-EventLog PSMDTAG:FAQ: EventLog
Posted by PowerShellTeam | 5 Comments
Filed under: ,

Encoding Operations Knowledge

One of the primary goals of Windows PowerShell is to encode operations knowledge. Consider the example of finding out what domain role a computer plays. If you look at the WMI class WIN32_COMPUTERSYSTEM, you'll see that it tells you this information:

Why do I sometimes get different types?

PSMDTAG:FAQ: Why do I sometimes get different types or different behaviors? PSMDTAG:FAQ: When I pipe a heterogenous set of objects to an cmdlet that expects a homogenous stream - what happens and why? In our newgroup ( Microsoft.public.Windows.PowerShell
Posted by PowerShellTeam | 1 Comments
Filed under: ,

Suppressing return values in PowerShell functions

PSMDTAG:FAQ: How do I supress return values in PowerShell functions? This was asked in a newgroup with the clarification: What I mean is: When you call a function Foo that returns a bool, PS will write 'True' or 'False' to the screenby default. Is there
Posted by PowerShellTeam | 5 Comments
Filed under:

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
Posted by PowerShellTeam | 3 Comments
Filed under: ,

Attachment(s): h.ps1
More Posts Next page »
 
Page view tracker