Back to the basics diorama tutorial. Learn how I cut my bricks for my diorama projects.
Back to the basics diorama tutorial. Learn how I cut my bricks for my diorama projects.
Here’s a quick tutorial on how to make a simple double hung window in the Brownstone style.
A quick tutorial I did to show one way of making a frosted glass effect for your diorama windows. Make sure you subscribe to my YouTube Channel for more. I plan on adding to my library of tutorials often.
Previously I wrote about how to create a Dynamic PowerShell Profile which allows you to choose upon execution of PowerShell whether you are running your scripts in a DEV state or PROD state.
In this article, I’ll go one step further and show you how to create a custom Desktop Shortcut that will automatically pass the parameters you’ve identified in your Dynamic PowerShell Profile so you don’t need to enter them when you double click the shortcut.
Scenario
In this scenario, I want to have 2 desktop shortcuts. One that will open PowerShell using my DEV profile and one that will open my PROD profile. Technically, the shortcuts are opening the same PowerShell executable, and are running the same profile. The difference is in the parameter/s it is passing when it executes.
Instructions
What Did We Just Do?
Let’s take a look at the additional text we added and break it down.
-noprofile = This tells powershell not to load the $profile we have created and associated with PowerShell. We’re not loading this initially because we want to easily pass a parameter without needing user interaction
-noexit = This tells PowerShell to stay open after executing. If you don’t include this, you’ll see the PowerShell application open and then it will disappear just like that. Allowing PowerShell to close right away is useful when you’re doing silent installs or other tasks that you don’t want/need the user to interact with the application once the process is complete.
-command . $profile = This tells PowerShell to run a command which is the . $profile command which is actually telling PowerShell to run the $profile script.
-inpType DEV = This tells PowerShell that you’re going to pass the $profile script a parameter with is named “inpType” which is created in the $profile script we created previously (you can name your parameters whatever you want). DEV is the parameter itself. You could pass PROD if you wanted instead.
Now, you can change the name of the shortcut to something like “DEV – Windows PowerShell” then copy and paste, rename the new one as “PROD – Windows PowerShell” then change the Target path entry to reflect a PROD parameter entry and now you have 2 shortcuts that will allow you to quickly run in DEV or PROD mode.
I hope this is useful to you. If you have questions or need assistance, feel free to post a question. If you need help adding to your profile, by all means post the question and hopefully I’ll be able to help you out.
If you’re writing PowerShell scripts the right way, you’re testing your scripts against a Test, or DEV environment prior to deploying those scripts to your Production environment (You ARE testing your scripts right?). If you’re using source control for your scripts (You ARE using source control for your scripts right?) then you’re likely using a DEV branch for your in progress script and then when all is ready you can Merge that into MAIN or whatever you call your production branch.
NOTE: If you aren’t using source control, branching & merging, and testing, you’ve probably got bigger problems than your PowerShell profile.
Scenario
If you are able to remotely run your code against your servers or if you’re like me and you’re managing Office 365, you’re running your test scripts and your production scripts on the same workstation.
Some of the common repeatable steps I have to take to differentiate my DEV and PROD instance are to change my directory I’m running my scripts from and since I write a lot of Modules, I need to ensure I’m using the correct Modules.
Out of the box, you’re going to have to manually change your directory and go in and add a temporary module directory depending on where your DEV and PROD modules are stored. I can write a script to do this and that’s what I’ve done, but instead of calling that script manually, why not incorporate it into your profile?
Solution
Below is a simple profile I’ve created for my workstation that allows me to determine what environment I’m working in when I run PowerShell. Now, I do nothing different when I open my Windows PowerShell. When it executes it runs the $profile and my script executes prompting me to enter “DEV” or “PROD” based on what I’m working on at the time.
Here’s the script you will copy and paste into your $profile file on your workstation. See below for the instructions.
param( [Parameter(Mandatory=$True,HelpMessage="Enter the environment you will be working on (DEV or PROD)")] [String]$inpType ) function Prompt { switch($inpType) { "DEV" { $color = "Yellow" } "PROD" { $color = "Green" } Default { Write-Host "ERR -- Environment Type entry not valid." `n -foregroundcolor Red } } Write-Host ($inpType + ">") -noNewLine -foregroundColor $color Return " " } if($inpType -eq "DEV") { $env:PSModulePath = $env:PSModulePath + ";<ENTER YOUR DEV MODULE PATH>" Set-Location "<ENTER YOUR DEV SCRIPT DIRECTORY>" prompt } Else { $env:PSModulePath = $env:PSModulePath + ";<ENTER YOUR PROD MODULE PATH>" Set-Location "<ENTER YOUR PROD SCRIPT DIRECTORY>" prompt } clear
What is this script doing?
There are three specific tasks this script is doing.
Instructions
Follow these steps to include the script above into your Windows PowerShell Profile. Note there are pieces you need to modify in the script above that are wrapped in <>’s. You’ll need to change the paths to represent your own locations.
Once you’ve entered the environment, your PowerShell prompt should look like the below image
Verify Your Profile Environment
It’s wise to verify you got the profile paths correct. Test that the $profile applied the variables as expected by running the following commands
Module Path
$env:PSModulePath
The information returned will be a semi-colon separated result including all current module paths. Your newly added path should be included in this
Current Directory
Get-Location
This should return the current directory your PowerShell session is set to right now. This should reflect your environment path you entered.
Prompt
You should be able to see the prompt is different depending on the input you chose.
PROD = PROD>
DEV = DEV>
If I Entered “DEV” Do I Have to Close PowerShell to get into “PROD”
No, you do not have to close out, though it might not be a bad idea depending on all the stuff you add to the profile. You can switch easily by entering the following command
. $profile PROD
There is a little bit of error handling, but not much in this script so be aware that you will want to augment this script if you want more error handling.
What can I do with this?
The sky is the limit. If you want to have specific modules loaded or snap-ins you know you’ll use, go ahead and add them. Just be warned, if you add too much stuff, it could slow the overall load time down as well.
Check back to my blog, I’ll show you how you can create a desktop shortcut to automatically enter the parameter so you can quickly get into your DEV or PROD PowerShell profile without entering anything.
We hope these helpful JMC end of Quarter tips, tricks, and instructions help you as you do your end of quarter grade processing and submissions. If you have questions or comments feel free to leave them below or e-mail us.
Check to make sure you are on the right TERM before entering any grades or information
Instructions
Office to Teacher
Your first step should be to perform an OFFICE to TEACHER
Scores/Assignment Scores
Enter your scores and grades
Calculate
You must calculate your grades from scores before proceeding!
Don’t Print
There is no need to print anything anymore.
Click Done
When you have completed all of your grade/score entry you can click the Done button
Teacher to Office
When you are ready to submit your grades to the office you will need to perform a Teacher to Office in JMC.
End of Semester
The only difference from Quarter to Semester is you must calculate each quarter and do the weights
We are excited to announce that this year (assuming all goes as planned) you will not need to set up your JMC IP Gradebook or JMC Attendance. We have worked this summer to create a script that copies all the needed files to their correct locations within your profile and then create the appropriate shortcuts on your desktop.
Unfortunately we don’t have an accurate record of all the buildings everyone works in so we have simply created an icon for each building on your desktop. Those buildings you do not need, simply delete them.
As with anything there are always flaws and errors, so don’t fret if you don’t see your Gradebook program or Attendance shortcut on your desktop. Try rebooting your computer once and see if they show up. If not, create a ticket at http://support.isd2899.k12.mn.us/support (Click Open New Ticket) and we’ll help you ASAP. It will be a quick and easy fix.
For instructions on how to use the JMC Gradebook and Attendance program check out the Training section of this site at: http://pemsupport.wordpress.com/training/
or find more JMC training resources at http://www.jmcinc.com/resources
Have a great start to the year.
Recently I and some other techs in the area have been setting up FOG servers and we have found the setup and installation of the FOG server to be well documented but the documentation for creating and uploading an image for Windows XP, Windows Vista, and Windows 7 are hard to come by.
Go to http://www.fogproject.org for more information on the FOG server software.
I decided to take it upon myself to write instructions for all 3 operating systems so I could be a useful participant in the group. Click the link below to download the instructions. If you find there are additions or corrections feel free to leave a comment as to what needs to be changed.
I hope these instructions will be useful to you.
Thanks to Brian, Bob, and Damon for all their help and input