You will undoubtedly need to use variables in your PowerShell scripts from time to time fortunately PowerShell has you covered. There are many built-in variables you can use to provide such information as the home folder ($pshome) or the current working folder ($pwd). If you would like to see a list of the built in and user defined variables available to the current session type;
Almost all of your PowerShell statements are going to include string values. Most of the time these strings are simply passed to cmdlets as arguments, but in a few cases, those strings are enclosed in either double or single quotes. The rules that govern when to use single or double quotes are referred to as quoting rules. This tutorial will attempt to explain those rules.
In this tutorial we are going to focus on how to use Powershell’s operators and wildcards. We’ve learned that we can connect cmdlets together using the pipe (|) to pipeline results to the Where-Object cmdlet, which filters objects passed down that pipline. In this example;
Well there is a new search engine on the block. It’s name is Cuil and its built by ex-Google engineers. Similar to Google the initial search page is simplistic and very reminiscent of early Google. I wanted to compare the two though to see what kind of results they return, and that is when the most obvious differences come to light.
The other day, one of my tech friends who is more familiar with linux then I, was talking about being unable to tail log files in windows. A command to do so didn’t immediately come to mind so I got to poking around on the inter tubes for a solution. As it turns out the tail command isn’t installed by default with windows but is available for download. The Microsoft downloads site offers the tail command with the Windows 2003 Resource Kit along with many other tools for administrating Active Directory, cleaning memory, raid configuration and lots more. I installed this kit and immediately noticed that when I typed tail /? at the command prompt I got an error. This error was due to windows not knowing where to find that particular command, so I had to add its location to my path. I right clicked my computer and then clicked properties. then I clicked advanced, then I clicked the button labeled “Environment Variables”. In the section labled “user variable for myusername ” I first clicked path and then clicked edit. I already had a variable in my path statement so I simply added the path to the resource kit install directory with this
;%SystemRoot%C:Program FilesWindows Resource KitsTools
then I clicked ok all the way back out, and then tested by typing tail /? which gave me the syntax to use when tailing a file.
The good people over at ars technica are reporting a rather neat (or horribly awful, depending on your view) team-up between Amazon and Tivo. Soon you’ll be able to buy those product placements from your favorite TV shows without even doing an amazon search. I could see this going one of two ways: TiVo customers (and impulse buyers) will love it OR it will be the most annoying piece of integrated technology since Microsoft gave us “clippy” the ever-so-annoying paper clip ‘helper’.
In other, non-related news, the times online is reporting the Webocalypse. Ok, ok, so it’s not really the end of the web, but it’s a start. Basically google has to give up 12 TB of YouTube user data to Viacom. Somehow Viacom thinks this will stop people from posting clips and shows on YouTube. It won’t. It will, however, give them more information than any possible ‘focus group’ could ever get on the viewing habits of young people. I’m assuming I don’t even need to mention the privacy issues this action brings up. Also The European Parliament added a law so each member state’s authorities could determine what software is appropriate for use on the internet. The article itself is a tad alarmist, but there are some very good points. I’m wondering how this might influence those of us across the pond.
This weeks PowerShell tutorial covers how to create pipelines and output management. Powershell pipelines are a series of cmdlets that pass objects from one to another. Each cmdlet generates an object and passes it to the next cmdlet via the pipeline. The receiving cmdlet uses that object as input and generates its own object as output. Connecting pipelines is done by using the pipe character (|).
Windows PowerShell is command-line scripting environment which uses the Microsoft .NET Common Language Runtime (CLR) and the .NET Framework. But unless you have Windows Server 2008 it doesn’t ship with Windows by default. You can however download it at www.microsoft.com/powershell. You will also need the .NET framework 2.0 if you don’t already have that installed.
Whether you travel with a laptop for business, or simply want to protect your data from prying eyes or hackers, encryption is quickly becoming a must for sensitive data. Fortunately Windows XP and Vista both offer encryption for files and directories.
1. First identify the folder you wish to encrypt.
2. Right click on that folder and then choose properties.
3. To the right of “Read-only” you should see a button labeled “Advanced…”. Click this button.
4. The fourth option down on this page should read “Encrypt contents to secure data”. Click the square white box next to this option to check mark it.
5. Click OK
6. Click Apply
7. Click OK to close after it has finished encrypting that folder.
Now if you need more protection then this, then you should consider one of the many full drive encryption softwares available. My personal favorite is CompuSec which also has a linux build!
Would you like to try out Linux, but haven’t a clue how to create a dual boot system? VirtualBox allows you to do just that. This is a software based virtualization platform that runs in Windows, Linux, Mac OS X, and Solaris that supports guests (virtual machines) of the same. Now you can easily roll out a Windows install on your Mac or Linux PC, or any other combination. As seen here, this is one of the coolest Linux demonstration videos I’ve had the chance to view, you’ll notice a Windows XP system running in the opposing desktop view in full screen even. The desktop effects you see are Compiz which I will discuss in a later post.