Question

Create the PowerShell script using NotePad (or use the PowerShell ISE). The PowerShell script is a...

Create the PowerShell script using NotePad (or use the PowerShell ISE).

The PowerShell script is a very simple one that simply prints the line: “Today is: “ followed on the next line by the actual date and time when the script is executed. (Major hint: use the cmdlet get-date.) 'Today is' going to bed red,while the date and time is going to be green.

Name your script: get-daymessage.ps1.

Name your task: displayDate.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Write_Host Today is get-date
Write_Host command is used to display a message followed by the command

get-date command will display the date.

Write these two statements in a notepad and use 'Save As' to save the file. Give the name as get-daymessage.ps1 (set save as type to 'All Files' in save dialog)

To execute, first execute the below statement in poweshell. Then call the script get-daymessage.ps1 using full path to file or navigate to file location using cd command and call the file

Set-ExecutionPolicy Remote Signed.

Thank you

Add a comment
Know the answer?
Add Answer to:
Create the PowerShell script using NotePad (or use the PowerShell ISE). The PowerShell script is a...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Task 12: Working with Windows PowerShell ISE You can use the Windows PowerShell Integrated Scripting Environment...

    Task 12: Working with Windows PowerShell ISE You can use the Windows PowerShell Integrated Scripting Environment (ISE) to create, run, and debug commands and scripts. The Windows PowerShell ISE consists of the menu bar, Windows PowerShell tabs, the toolbar, script tabs, a script pane, a console pane, a status bar, a text-size slider and context-sensitive Help. It works for both local and remote scripts. Using the Windows PowerShell ISE gives you many different advantages when creating scripts. Although it can...

  • 4. Using Technique 1 from the text book, write the PowerShell script that will create a...

    4. Using Technique 1 from the text book, write the PowerShell script that will create a custom object named Q4 with the properties and values as indicated in the below table. The last line in your script should output the object to the screen. Property Name FirstName LastName ProcessName Property Value Your first name Your last name The name of the first process running on your VM. You should use Get-Process in your script to retrieve this name. The ID...

  • Write a script using simple shell commands. The script takes a command line argument that specifies...

    Write a script using simple shell commands. The script takes a command line argument that specifies a directory dir. The script first changes directory to dir, then prints the following in sequence: (a) A line starting “Current date and time: ”. Then on the same line, the current time and date. (b) A line starting “Current directory is : ”. Then, on the same line, the absolute pathname of the current working directory. (c) An empty line (d) The line...

  • UNIX QUESTION Exercise #1. [8 Marks] Create a script that does the following: a. Takes 4...

    UNIX QUESTION Exercise #1. [8 Marks] Create a script that does the following: a. Takes 4 input parameters b. Using the shell special variables print the following: i. The command you executed ii. First input iii. Second input iv. Third input v. Fourth Input vi. Process Id vii. Total number of input parameters [ by querying the system for it ] Exercise #2. [8 Marks] Creates a script that does the following: a. Takes two input parameters b. Using the...

  • CIT 214 - Homework 4 - Alexamara Marina Group Multiple Table Queries Use Notepad to create...

    CIT 214 - Homework 4 - Alexamara Marina Group Multiple Table Queries Use Notepad to create the commands that will run the following queries/problem scenarios. For every boat, list the marina number, slip number, boat name, owner number, owner's first name, and owner's last name. For every completed or open service request for routine engine maintenance, list the slip ID, description, and status. For every service request for routine engine maintenance, list the slip ID, marina number, slip number, estimated...

  • Write a python program and pseudocode The Program Using Windows Notepad (or similar program), create a...

    Write a python program and pseudocode The Program Using Windows Notepad (or similar program), create a file called Numbers.txt in your the same folder as your Python program. This file should contain a list on floating point numbers, one on each line. The number should be greater than zero but less than one million. Your program should read the following and display: The number of numbers in the file (i.e. count them) (counter) The maximum number in the file (maximum)...

  • This problem will introduce you the MATLAB (if you have not used it before). In this...

    This problem will introduce you the MATLAB (if you have not used it before). In this course we will use MATLAB in a limited fashion to give you a glimpse on how it is used to solve engineering problems. In your junior year, you will spend an entire semester in AEM 3101 becoming very proficient in using MATLAB for engineering modeling and simulation purposes. In this problem you will use MATLAB to accomplish the following tasks: (a) Write a function...

  • cs55(java) please Part 1: You are a programming intern at the student transfer counselor's office. Having...

    cs55(java) please Part 1: You are a programming intern at the student transfer counselor's office. Having heard you are taking CS 55, your boss has come to ask for your help with a task. Students often come to ask her whether their GPA is good enough to transfer to some college to study some major and she has to look up the GPA requirements for a school and its majors in a spreadsheet to answer their question. She would like...

  • WRITE IN PSEUDOCODE USING THE FOLLOWING GUIDELINES Classes Program 1: WAKA, WAKA. Pac-Man was a big...

    WRITE IN PSEUDOCODE USING THE FOLLOWING GUIDELINES Classes Program 1: WAKA, WAKA. Pac-Man was a big hit back in the 80s. One of the things he could do was “teleport” from one side of the screen to the other, and that’s what we’re going to implement here. For this program, you’re going to write a class (called “PacMan”) that only has two attributes: an X and Y location. Imagine the player is on a 10x10 grid and starts at location...

  • Help Please on JAVA Project: Validating the input is where I need help. Thank you Requirements...

    Help Please on JAVA Project: Validating the input is where I need help. Thank you Requirements description: Assume you work part-time at a sandwich store. As the only employee who knows java programming, you help to write a sandwich ordering application for the store. The following is a brief requirement description with some sample output. 1. Selecting bread When the program starts, it first shows a list/menu of sandwich breads and their prices, then asks a user to select a...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT