tag:blogger.com,1999:blog-2642811421339863432024-03-19T05:10:07.868-06:00Ryan's BlogWho is this Ryan guy anyways?iamryanjdeckerhttp://www.blogger.com/profile/08914028393819038920noreply@blogger.comBlogger7125tag:blogger.com,1999:blog-264281142133986343.post-9243031010173723282018-11-13T00:11:00.001-07:002018-11-15T23:40:33.105-07:00Different Ways to Use PowerShell<h4 id="toc">
Table of Contents
</h4>
<ul>
<li>
<a href="#introduction">Introduction</a>
</li>
<li>
<a href="#ps-from-cmd">Running PowerShell from the old Command Prompt</a>
</li>
<li>
<a href="#psscripts">Running PowerShell from a PowerShell Script</a>
</li>
<ul>
<li>
<a href="#psscript-click">Running a PowerShell Script by Clicking the Icon</a>
</li>
<li>
<a href="#psscript-from-ps">Running a PowerShell Script via a PowerShell Window</a>
</li>
<li>
<a href="#psscript-from-cmd">Running a PowerShell Script via Command Prompt</a>
</li>
<li>
<a href="#psscript-from-psscript">Running a PowerShell Script from Another PowerShell Script</a>
</li>
<li>
<a href="#psscript-from-batch">Running a PowerShell Script or Command from a Batch Script</a>
</li>
</ul>
<li>
<a href="#pstasks">Using PowerShell with Task Scheduler</a>
</li>
<ul>
<li>
<a href="#pstask-from-powershell">Using a Scheduled Task with powershell.exe to Execute PowerShell Code</a>
</li>
<li>
<a href="#pstask-from-batch">Using a Scheduled Task with a Batch Script to Execute PowerShell Code</a>
</li>
</ul>
<li>
<a href="#conclusion">Conclusion</a>
</li>
</ul>
<h4 id="introduction">
Introduction
</h4>
<p>
Using PowerShell on the command line is not the only way to use PowerShell.
</p>
<p>
You can write PowerShell scripts. You can run PowerShell from the old Command Prompt. You can run PowerShell from batch scripts, other PowerShell scripts, scheduled tasks, etc.
</p>
<p>
<a href="#toc">Back to the TOC</a>
</p>
<h4 id="ps-from-cmd">
Running PowerShell from the old Command Prompt
</h4>
<p>
First, lets look at the difference between running PowerShell from the PowerShell command line interface (powershell.exe) vs running PowerShell from the old Command Prompt (cmd.exe).
</p>
<p>
To run PowerShell commands from within powershell.exe, you just use the language as usual:
</p><a href="https://www.iamryanjdecker.com/2018/11/different-ways-to-use-powershell.html#more"></a>iamryanjdeckerhttp://www.blogger.com/profile/08914028393819038920noreply@blogger.com1tag:blogger.com,1999:blog-264281142133986343.post-56887670708867655052018-10-23T18:52:00.000-06:002018-11-11T21:26:52.329-07:00Mastering the Basics of PowerShell<h4 id="mtbops-toc">Table of Contents</h4>
<ul>
<li>
<a href="https://www.iamryanjdecker.com/2018/10/introduction-powershell-is-different.html#mtbops-introduction">Introduction</a>
</li>
<li>
<a href="https://www.iamryanjdecker.com/2018/10/introduction-powershell-is-different.html#mtbops-executive-summary">Executive Summary</a>
</li>
<li>
<a href="https://www.iamryanjdecker.com/2018/10/introduction-powershell-is-different.html#mtbops-learn-cmdlets">Learn About Cmdlets</a>
</li>
<li>
<a href="https://www.iamryanjdecker.com/2018/10/introduction-powershell-is-different.html#mtbops-learn-return-objects">Learn About Return Objects' Data Types and Data Members</a>
</li>
<li>
<a href="https://www.iamryanjdecker.com/2018/10/introduction-powershell-is-different.html#mtbops-pipeline-objects">Pipeline Flow - Object Oriented</a>
</li>
<li>
<a href="https://www.iamryanjdecker.com/2018/10/introduction-powershell-is-different.html#mtbops-pipeline-text">Pipeline Flow - Text</a>
<li>
<a href="https://www.iamryanjdecker.com/2018/10/introduction-powershell-is-different.html#mtbops-conclusion">Conclusion</a>
</li>
<h4 id="mtbops-introduction">INTRODUCTION</h4>
<p>
In my opinion, the most important thing about learning PowerShell, scripting or programming language, or anything at all, is to start with a good foundation, or you'll waste a lot of time.
</p>
<p>
PowerShell is a rocket ship. Can you just get into a rocket ship and learn as you go? Maybe, but there's a very, very high chance that you will crash and burn. Learn how to operate the ship before you attempt to fly.
</p>
<p>
This lesson does not delve deep into the features and capabilities of PowerShell. This lesson will teach you everything you need to know to get this rocket ship off the ground. You can take it to the next country, planet, or galaxy. That part is up to you.
</p>
<p>
PowerShell is different from other shells, as it is object oriented.
Old shells process, parse, and produce text.
PowerShell processes objects or text, parses text, and produces objects or text.
</p>
<p>
Let's compare the difference between these two ideas:
</p>
<ol>
<li>PowerShell scripts (.ps1 files) with <em>cmdlets</em></li>
<li>Batch scripts (.bat or .cmd files) with <em>commands</em></li>
</ol>
<p>
The old command prompt and batch scripts work this way:
</p>
<p>
You use command line programs that typically end with <code>.exe</code>. These are not commands, they are compiled programs. Try entering <code>cd.exe /?</code> or <code>whoami.exe /?</code> on the old command prompt. As you can see, the question mark argument <code>/?</code> is available in almost all command line programs, or "commands," in the old Windows shell (Command Prompt).
</p>
<p>
In PowerShell, Cmdlets are like the old command line programs. They are not functions or commands. They are actually programs, usually written in C# following strict specifications, to work intuitively and as expected in PowerShell.
</p>
<p>
<a href="https://www.iamryanjdecker.com/2018/10/introduction-powershell-is-different.html#mtbops-toc">Back to the TOC</a>
</p>
<h4 id="mtbops-executive-summary">EXECUTIVE SUMMARY</h4>
<p>
To learn the basics of PowerShell, you need to know <strong>four</strong> basic things:
</p>
<p>
<strong>First</strong>, you need to know how to help yourself learn. PowerShell provides three cmdlets that you will use consistently during your experience with the language: <code>Get-Help</code>, <code>Get-Command</code>, and <code>Get-Alias</code>. You will always use these cmdlets as long as you're reading or writing PowerShell.
</p>
<p>
<strong>Second</strong>, you will need to realize that learning about and examining cmdlets, and learning about and examining <em>cmdlet output,</em> are two entirely separate things. This is very, very easy to mix up. If you can keep these two ideas separate, you'll be able to learn the language <em>much</em> more quickly.
</p>
<p>
You'll use <a href="https://docs.microsoft.com/en-us/dotnet/api/system.object.gettype?view=netframework-4.7.2#System_Object_GetType">System.Object</a>'s <code>.GetType()</code> <em>method</em> and the <code>Get-Member</code> cmdlet to inspect cmdlet return values. In addition to the help based cmdlets in the previous paragraph, you'll always be using <code>.GetType()</code> and <code>Get-Member</code> as well.
</p>
<p>
<strong>Third</strong>, you're going to need to learn a very simple concept called the "pipeline." It's as simple as saying that one cmdlet can send its output to the next cmdlet. Then, that cmdlet can send <em>its</em> output to <em>another</em> cmdlet, and on and on, as long as you need it to go on.
</p>
<p>
The <strong>fourth</strong> and final concept needed to Master the Basics of PowerShell, is to know the difference between processing text output and processing object oriented output. Old shells like CMD.EXE, BASH, and Cisco's IOS shell, only handle text based output, whereas PowerShell has the additional ability to handle object oriented output. If you understand how this handling of object oriented data is different than handling text based data, you'll understand the most fundamental way that PowerShell is different from other shells.
</p>
<p>
<a href="https://www.iamryanjdecker.com/2018/10/introduction-powershell-is-different.html#mtbops-toc">Back to the TOC</a>
</p>
<h4 id="mtbops-learn-cmdlets">LEARN ABOUT CMDLETS</h4>
<p>
The first cmdlets you should know in PowerShell are <code>Get-Help</code>, <code>Get-Command</code>, and <code>Get-Alias</code>. If you ever have questions about any cmdlet in PowerShell, you can search online on <a href="https://msdn.microsoft.com/en-us/library/gg145045(v=vs.110).aspx">MSDN</a>, <a href="https://blogs.technet.microsoft.com/heyscriptingguy/">TechNet</a>, or <a href="https://docs.microsoft.com/en-us/powershell/scripting/powershell-scripting?view=powershell-5.1">Microsoft Docs</a> for help. You can also just use PowerShell.
</p>
</li></ul><a href="https://www.iamryanjdecker.com/2018/10/introduction-powershell-is-different.html#more"></a>iamryanjdeckerhttp://www.blogger.com/profile/08914028393819038920noreply@blogger.com0tag:blogger.com,1999:blog-264281142133986343.post-22934418926706183462015-07-15T16:27:00.000-06:002018-10-22T15:21:36.596-06:00Trouble Disabling Blogger Pageviews?<h4>Blogger stopped letting me disable my own pageviews after setting up my own domain.</h4>
<p class="rreedd">
If you recently added your own domain to your Blogger blog and if you also can't disable your pageviews, I found a possible solution for you. I found it on this page from <a href="http://www.ittimesbd.com/2014/10/fix-blogger-dont-track-own-pageview.html">IT Times BD</a>.
</p>
<p>
Try slapping this into your address bar:
<pre>
http://www.<span class="font-blue">Your-Domain</span>.com/b/statsBlockingCookie?action=SET&callback=__gwt_jsonp__.P2.onSuccess
</pre>
</p>
<p>
Obviously, edit "Your-Domain" out of the url to match your domain. If that doesn't help, I don't know what to tell you. If this works for you, please leave a comment with <a href="http://www.ittimesbd.com/2014/10/fix-blogger-dont-track-own-pageview.html">IT Times BD</a> and tell them how much they rock for doing the hard work of finding a fix for all of us!
</p>iamryanjdeckerhttp://www.blogger.com/profile/08914028393819038920noreply@blogger.com1tag:blogger.com,1999:blog-264281142133986343.post-51132385376282229462014-05-20T15:00:00.001-06:002018-10-23T19:11:17.401-06:00What is Free software?<h4>Introduction</h4>
<p>
Many people think they know what free software is but are completely wrong. Many people also assume that open source software is a synonym for free software. It is definitely not. Let me begin by showing you the three main classifications of software.
</p>
<ul>
<li>Free Software</li>
<li>Open Source Software</li>
<li>Proprietary Software</li>
</ul>
<h4>Informal Descriptions and Examples</h4>
<p>
Here are my informal descriptions of each of these types of software.</p>
<h5>Free Software: Description</h5>
<p>
The word <q>free</q> in free software does not refer to money. It refers to freedom. If you have software which is classified as <q>free software,</q> then you have the <em>freedom</em> to modify, copy, or redistribute the source code or the program itself without punishment. And just because it's called <q>free software,</q> that does not mean that you cannot use it to make money.
</p>
<p>
Personally, I feel that the term <q>free software</q> is a horrible and misleading name for this software. To me, I believe a much better name for it would be <q>freedom software</q>. This way, it clearly emphasizes the purpose and nature of the software.
</p>
<a href="https://www.iamryanjdecker.com/2014/05/what-is-free-software.html#more"></a>iamryanjdeckerhttp://www.blogger.com/profile/08914028393819038920noreply@blogger.com0tag:blogger.com,1999:blog-264281142133986343.post-42776454376261385092014-01-30T02:03:00.001-07:002014-05-18T11:05:54.705-06:00Disable Annoying Facebook Chat Heads<p dir=ltr>
Facebook absolutely loves to irritate you by changing things around when you start to get used to one of its ever changing interfaces.
</p>
<p dir=ltr>
I absolutely loath the annoying chat heads and annoying sounds for the Facebook Messenger mobile app, my God.
</p>
<p dir=ltr>
Before I get started, let me give you the publish year and month of this article since either the app hid its version number or it just doesn't have one. Then you'll know, if the interface changes, whether these directions are applicable or not: <b>January 2014</b>.
</p>
<p dir=ltr>
Let me show you how to rid yourself of this horrible nuisance:
</p>
<ol>
<li>Open the app.</li>
<li>Tap the sprocket on the top right.</li>
<li>Edit settings to disable those damned chat heads, nosy location tracking, and annoying chat sound effects all right here.</li>
</ol>
<p dir=ltr>
Boom! I hope this helps.
</p>
iamryanjdeckerhttp://www.blogger.com/profile/08914028393819038920noreply@blogger.com1tag:blogger.com,1999:blog-264281142133986343.post-23616431114479138922012-08-22T14:34:00.000-06:002016-07-20T08:53:50.042-06:00Never Throw Out Old Equipment!!<p>
Long story short, I took 3 pieces of junk and transformed them into marvelous computing machines.
</p>
<p>
I have two old Dell Latitude C510/C610 computers. I'm guessing they're made from sometime around early 2000. The other computer is an HP DV9000, but I'll get into that later. Anyways, the people that owned the two Dells threw them out as garbage a couple years ago. One person's trash is another person's treasure, I guess!
</p>
<a name='more'></a>
<p>
As for the Dells: One has Windows 2000, about 256 RAM and a 20GB hard drive. The other has XP, which doesn't even work, (there will be another blog about this soon) and has 512 RAM. (I don't remember how big the hard drive is.)
</p>
<p>
I put the newest version of Ubuntu Server as of March 2012 (11.10 Oneiric Ocelot) on the one with XP. Then I hooked up a 500GB Hard Drive with all my music (100GB) pictures (50GB) and videos (?GB). Now I can access my files from any computer on my home network. This computer is about 10 years old and still runs modern software - amazing!
</p>
<p>
As for the Windows 2000 computer, there's a short story why I'm even using it. The cheaply built hinges on my HP DV9000 with Vista broke (there might be a blog about this soon.) So what did I do? I put XBMC on my HP DV9000 (which came with a remote controller and a built-in non-USB sensor) and hooked it up to my brother's LG TV (120Hz 1080p). This is what I use to access my media files via my server. Plus, it would play DVDs if the stupid optical drive wasn't junk. Regardless, it makes for an excellent home media center.
</p>
<p>
So what does that have to do with the Windows 2000 computer? Well, with my other computers being used for server and media center purposes, I would need a computer for traditional use. And since Windows 2000 is so obsolete that the video and network cards are unsupported, (there will be a blog about this soon) I put Debian 6 on it with LXDE. I even got an old Linksys WPC11 Version 4 Wireless-B Notebook Adapter to work on this piece.
</p>
<p>
Now that I have Debian installed with LXDE, it seems to run just as fast as my Vista or Windows 7 computer now! It boots up faster, that's absolutely certain. I'm not sure exactly how much faster. I'm too lazy right now to get up and check it out.
</p>
<p>
What's the moral of the story? Never throw out old equipment!
</p>iamryanjdeckerhttp://www.blogger.com/profile/08914028393819038920noreply@blogger.com1tag:blogger.com,1999:blog-264281142133986343.post-85294953661223247252012-06-05T15:18:00.000-06:002018-10-28T01:27:57.464-06:00Homemade Fruit Parfait<div>
<img alt="Image: Fruit Parfait" title="Doesn't this look delicious?" width="100%" height="100%" align="middle" src="http://i349.photobucket.com/albums/q367/bbuggahmuggahxz/Special/0-Food/DSC_0008.jpg">
<p>
The other day I went to McDonald's and ordered a fruit parfait. It was delicious!
I thought to myself, <q>Why am I buying this from somebody else while I could be
making this myself??</q> That's exactly why I am writing this post.
</p>
<p>
Before showing you a very simple way to make a fruit parfait, I believe it is important
to share with you the meaning of the word <q>parfait</q>.
</p>
<p>
According to dictionary.com, the word parfait is <q>Short for French parfait (parfait
glacée), an iced dessert made with egg yolks, sugar, cream, and flavoring (usually
fruit), sometimes with the addition of a liqueur.</q>
</p>
<p>
See, it seems that a traditional parfait is ice cream.
</p>
<p>
Anyway, here's what you'll need for a <em>yogurt</em> parfait:
</p>
<ul>
<li>Vanilla Yogurt</li>
<li>Fruit (Strawberries for Me!)</li>
<li>1 Dry and Crunchy Granola Bar (≈90 calories)</li>
</ul>
<p>
That's it!
</p>
<p>
I like to put yogurt on the bottom of a pretty small glass (like an 8 ounce glass) then add fruit.
Then I cover the fruit with more yogurt. I like to top it off with a crunched up granola bar.
</p>
<p>
Some additional tips: Don't put in too much yogurt and keep the granola in marble-sized
chunks. That yogurt goes fast and the granola is easier to chew in bigger chunks.
</p>
</div>iamryanjdeckerhttp://www.blogger.com/profile/08914028393819038920noreply@blogger.com0