April 25th, 2006

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}
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.]

Category
PowerShell

Author

PowerShell Team
PowerShell Team

PowerShell is a task-based command-line shell and scripting language built on .NET. PowerShell helps system administrators and power-users rapidly automate tasks that manage operating systems (Linux, macOS, and Windows) and processes.

0 comments

Discussion are closed.