|
|
Browse by Tags
All Tags » powershell
-
While I'm waiting for some files to copy around I thought I'd record my recent PowerShell learnin'.
Somtimes a command, like Get-ChildItem can return either an array of results or just a single one. You can use the @ symbol to cast the result into an array, so:(gci -i *.txt).Count
Sometimes returns nothing, whereas:@(gci -i ...
-
Starting to get the hang of PowerShell. Today I wanted to quickly count the number of lines in some source code. There's a simple implementation and then there's a better one. In the end I settled on:$count=0;gci . -i *.cs,*.cpp,*.h -r | %{$count += [System.IO.File]::ReadAllLines($_.FullName).Count};$count
Which is ...
-
Still struggling to gain traction with PowerShell. I've stopped myself running the CMD prompt by default, and I've installed it on all my test VPC machines.
Firstly, I recommend you download the Windows PowerShell Graphical Help File. It's an old school .chm file, but you can search it. Don't underestimate how useful this is ...
-
I've held off moving to Windows PowerShell. The reason is that I came up with a solution for running C# source directly from the command line as script a few years ago using CodeRunner .NET, and I've haven't had a pressing need for more functionality.
But I decided that the time has come to say goodbye to the ...
|
|
|