Showing results for 2006 - Page 21 of 21 - PowerShell Team

Apr 25, 2006
Post comments count0
Post likes count0

Duplicate Files

PowerShell Team
PowerShell Team

Need a way to check if two files are the same?  Calculate a hash of the files.  Here is one way to do it:   ## Calculates the hash of a file and returns it as a string. function Get-MD5([System.IO.FileInfo] $file = $(throw 'Usage: Get-MD5 [System.IO.FileInfo]')) {   $stream = $null;   $cryptoServiceProvider = [System.Sec...

Apr 25, 2006
Post comments count0
Post likes count0

Adding Notes

PowerShell Team
PowerShell Team

  A while back I mentioned that there was a way of adding notes to objects in the shell. Here is one way to do it: ## Adds a note to the pipeline input. filter AddNote([string] $name, $value) { $mshObj = [System.Management.Automation.MshObject] $_; $note = new-object System.Management.AUtomation.MshNoteProperty $name, $value $mshObj.MshObj...

Apr 25, 2006
Post comments count0
Post likes count0

MshObject and Methods that take object

PowerShell Team
PowerShell Team

Every once in a while people ( including me) run into trouble calling methods that take object.  Why?  Well, as I told you earlier objects in MSH are wrapped by an invisible MshObject.  As it turns out that this invisible object is not always so invisible.  Take a look at the following:   MSH>$key = get-item . MSH>...

Apr 25, 2006
Post comments count0
Post likes count0

Support for Existing apps in Monad

PowerShell Team
PowerShell Team

Monad provides strong support for existing apps and technology.  If you use native cmdline exes, vbscripts, batch files, perl scripts etc to manage and maintain windows, you can pretty much use them the same way from monad as you would from cmd.exe.   For example, I am used to findstr.exe and xcopy.exe. I can use them from monad as is....

Apr 25, 2006
Post comments count0
Post likes count0

Did you know? #4

PowerShell Team
PowerShell Team

Did you know that you can access most of the Cmdlet base class APIs through script using the $executioncontext variable? -Jeff Jones

Apr 25, 2006
Post comments count0
Post likes count0

Did you know? #3

PowerShell Team
PowerShell Team

Did you know that you can put constraints on variables using the same attributes as cmdlet parameters?Unfortunately we had to postpone the language support for this but you can still do it using new-object.MSH > $a = "foo"MSH > $varA = get-variable aMSH > $varAName            &...

Apr 25, 2006
Post comments count0
Post likes count0

Did you know? #1

PowerShell Team
PowerShell Team

Did you know that you can access the content of a provider using the variable syntax? For instance, you can get and set the contents of a file just by doing the following:MSH > ${c:\temp\foo.txt} = "bar"MSH > ${c:\temp\foo.txt}barMSH > Note, the default encoding is used when setting the content in the filesystem in this way. Any provide...

Apr 25, 2006
Post comments count0
Post likes count0

Did you know? #2

PowerShell Team
PowerShell Team

Did you know that you can make a variable automatically propagate to new scopes by using the AllScope option? Normally when you enter a new scope variables are not copied from the parent scope. Instead we do a lookup for the variable when requested. Anytime the variable is written to it happens in the local scope. This means that it is possible ...

Apr 25, 2006
Post comments count0
Post likes count0

Introduction to MshObject

PowerShell Team
PowerShell Team

If you’ve ever worked with the Monad APIs then you’ve no doubt seen a type called System.Management.Automation.MshObject.  I’m not going to go into all the details of what it is because that would take me more time than I have right now and there are people who can explain better than I.  Suffice it to say that it’s a wrapper class and...

Apr 25, 2006
Post comments count0
Post likes count1

Windows PowerShell (Monad) Has Arrived

arulk
arulk

I just got out of Bob Muglia's keynote speech where he formally announced Windows PowerShell (previously known as Monad).  The key things he announced are: Superstar Vivek Sharma demonstrated the Exchange 2007 Admin experience. First he showed their new MMC 3.0 managed code snap-in - it totally rocks! (you'll be amazed by what you can do wit...