CIS Unit 2 Lab 1 Writing a Basic Script

Anonymous
timer Asked: Nov 11th, 2016

Question description

Unit 2 Lab 1: Writing a Basic Script

Using the NETLAB+ virtual environment, complete the following Lab. Ensure you have read the Preparation information, too. It is strongly suggested that you open the Lab Instructions in one window and the virtual devices in another and arrange them side by side so you may read the instructions in one window and type the commands in the other.

Using the NETLAB+ virtual environment (on the VCASTLE servers), complete the following Lab:

  Unit 2 Lab 1 Instructions

Directions: As you complete the Lab Instructions, upload your completed script into the Dropbox for below. Make sure your Get-Help function works properly and be sure to include all comments.

Note Please Use The Unit 2 Lab 1 Instructions in this file To Complete This Project:

Prepare your Unit 2 Lab 1 in a document named Lastname_U2_Lab1.ps1. Submit your file using the upload instructions below.


UNIT 2 LAB 1 INSTRUCTIONS: WRITING A BASIC SCRIPT OVERVIEW Most scripts are written using a common architecture. This architecture is designed to make scripts easy to understand, modify, and debug. In this lab, you will create a script that uses the basic script architecture that you may easily modify for use in future projects. OBJECTIVES 4.5. 4.6. 5.1. Create meaningful comments in a script Write a basic script template that contains the basic parts of a script. Use input and output commands. PREREQUISITES A virtual machine with Windows 8.1 or newer or Windows Server 2012 R2 installed. SCENARIO Your organization is investigating the use of the command line and scripting for network administration. It has been decided that scripting will be used extensively and that a basic template that contains an organized architecture and some preconfigured information would be useful. TASKS Many parts of a script such as organization, comments, and help documentation are redundant. To make scripting more efficient, we will create a script template that contains this redundant information. CREATING A SCRIPT TEMPLATE CREATING COMMENT BASED HELP DOCUMENTATION 1. Start your server virtual machine. 2. For these steps, you will need to login using the administrator account. 3. Create the folder C:\users\administrator\scripts for your scripts. UNIT 2 LAB 1 INSTRUCTIONS: WRITING A BASIC SCRIPT 4. Open the PowerShell ISE. a. In the script pane, type the following: <# .SYNOPSIS This is a template script and this is where you would type a synopsis of the command .DESCRIPTION This is a template script and this is where you would type a more detailed description of the command .EXAMPLE This is a template script and this is where you would type your first example of how to use this command. .EXAMPLE This is a template script and this is where you would type your second example of how to use this command. #> 5. Save the file as template.ps1 in the scripts folder, you created previously. 6. Change to this directory by typing the following in PowerShell Set-Location c:\users\administrator\scripts OR cd c:\users\administrator\scripts 7. Type the following to verify that your help documentation works correctly. Get-Help .\template.ps1 UNIT 2 LAB 1 INSTRUCTIONS: WRITING A BASIC SCRIPT 8. You should see the output below. 9. Type the following to verify that your help documentation example sections work correctly. Get-Help .\template.ps1 -Examples 10. You should see the output below. 11. Other keywords and sections can be added. You can learn about these in the about_Comment_Based_Help topic. UNIT 2 LAB 1 INSTRUCTIONS: WRITING A BASIC SCRIPT ADDING COMMENTS Additional comments should be added to a script to identify the author, the date that the script was written, and for program code that requires additional explanation. To create the comments for the author and date written, add the following lines to the template.ps1 script: #Written by YourName on TheCurrentDate Substitute your name for YourName and today’s date for TheCurrentDate. Note: This line needs to come after the help information that you typed previously. Add the following comments after the comment above: #Initialization # This section contains variable declarations and assignments #Functions #This section contains function definitions #Main Body #This section contains the code that implements that main function of the script.

Tutor Answer

(Top Tutor) Studypool Tutor
School: Carnegie Mellon University
Studypool has helped 1,244,100 students
flag Report DMCA
Similar Questions
Hot Questions
Related Tags
Study Guides

Brown University





1271 Tutors

California Institute of Technology




2131 Tutors

Carnegie Mellon University




982 Tutors

Columbia University





1256 Tutors

Dartmouth University





2113 Tutors

Emory University





2279 Tutors

Harvard University





599 Tutors

Massachusetts Institute of Technology



2319 Tutors

New York University





1645 Tutors

Notre Dam University





1911 Tutors

Oklahoma University





2122 Tutors

Pennsylvania State University





932 Tutors

Princeton University





1211 Tutors

Stanford University





983 Tutors

University of California





1282 Tutors

Oxford University





123 Tutors

Yale University





2325 Tutors