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}
bar
MSH >
Note, the default encoding is used when setting the content in the filesystem in this way.
Any provider that supports the IContentCmdletProvider interface can be accessed in this way.
-Jeff Jones
[Edit: Monad has now been renamed to Windows PowerShell. This script or discussion may require slight adjustments before it applies directly to newer builds.]
0 comments