Display: Cloud | List
Most Popular Tags
Results (4 total) All > powershell (x) > system.io.directory (x)
System.Io.Directory class using PowerShell (Directory Class (System.IO))
# Get-Dirinfo2.ps1# Manupulates directories using system.io.directory class and PowerShell# Thomas Lee - tfl@psp.co.uk# MSDN Sample recoded using PowerShell # Specify the folders to manipulate $path = "D:\foo1"$target = "D:\TestDir" # Create the $path directory it does not exist.if (! [System.Io.Directory]::Exists($path)) { $dir= [System.Io.Directory]::CreateDirectory($path); "Director
Last modified by Thomas Lee on 8/11/2010 11:16:14 AM
Sample Using PowerShell (Directory.CreateDirectory Method (String) (System.IO))
<#.SYNOPSIS This script Creates then removes a folder using methods in System.IO.Directory..DESCRIPTION This script checks to see if a staticly named folder exists. if not, it creates then removes the folder. The creation/deletion logic in enclosed within a try/catch block to capture errors..NOTES File Name : New-Folder.ps1 Author : Thomas Lee - tfl@psp.co.uk Requ
Last modified by Poshoholic on 10/9/2009 1:36:59 PM
Sample Using PowerShell (Directory.GetFiles Method (System.IO))
<#.SYNOPSIS This script displays the size of a folder.DESCRIPTION This script is a rewrite of an MSDN sample. It uses System.IO namespace to determine the size of a folder and its subfolders, then displays it. Note that the Get-DirSize function is recursive! .NOTES File Name : Get-FolderSize.ps1 Author : Thomas Lee - tfl@psp.co.uk Requires : PowerShell V2.LINK This
Last modified by Thomas Lee on 10/5/2009 11:31:25 AM
Sample Using PowerShell (Directory.GetFiles Method (String, String, SearchOption) (System.IO))
# get-files.ps1 # Gets files using system.io.directory.getfiles() # Thomas Lee - tfl@psp.co.uk # Get all files in C:\Foo\test "Files in C:\Foo\test" [system.IO.Directory]::GetFiles("C:\foo\test") "" # Get all files in c:\foo\test\*.txt "Files in C:\Foo\test\*.txt" [system.IO.Directory]::GetFiles("C:\foo\test", "*.txt") "" # Get all files in c:\foo\test\*.* /s "Files in C:\F
Last modified by Thomas Lee on 11/9/2008 5:59:07 PM
Page view tracker