Powershell – Copyrighting made easy

I recently needed to submit a program I’m working on for a copyright. One of the criteria is the first and last 25 pages of the program need to be submitted. I really didn’t want to go into every source code file and append it to a file manually, I have more important things to do than that. I used my old friend Powershell to get what I needed.

Here is the line:

> ls *.cs -recurse | ?{-not ($_.fullname -match “obj”) -and -not ($_.fullname -match “properties”)} | Get-Content > sourcecode.txt

What this is doing is grabbing all of my C# code from my solution (excluding code in the obj and properties folders) and dumping it to a text file.

From there I was able to upload one file.

About these ads

Have an opinion? Leave an opinion!

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s