Difference between revisions of "Functions"

From MyWiki
Jump to: navigation, search
Line 1: Line 1:
 
http://windowsitpro.com/windows/create-your-own-powershell-functions<br><br>
 
http://windowsitpro.com/windows/create-your-own-powershell-functions<br><br>
function FileSize3 ($dir, $minSize)
+
function FileSize2
\{<br>
+
\{
dir $dir |<br>
+
  dir $args\[0\] |
where \{$_.length -gt $minsize<br>\}
+
  where \{$_.Length -gt 100000\}
\}<br><br>
+
\}
 
Is called like this:<br>
 
Is called like this:<br>
 
FileSize3 -dir C:\Windows ` ( The back tick continues on a new line ) <br>
 
FileSize3 -dir C:\Windows ` ( The back tick continues on a new line ) <br>
 
-minSize 100000 <br>
 
-minSize 100000 <br>

Revision as of 19:27, 26 August 2014

http://windowsitpro.com/windows/create-your-own-powershell-functions

function FileSize2
\{
 dir $args\[0\] |
 where \{$_.Length -gt 100000\}
\}

Is called like this:
FileSize3 -dir C:\Windows ` ( The back tick continues on a new line )
-minSize 100000