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)...

  • i need help with this scripting assignment in power shell thanks Lab 7: PowerShell Search and...

    i need help with this scripting assignment in power shell thanks Lab 7: PowerShell Search and Report Search Report host path date Execution time nnn Directories n, nnn, nnn Files nnnnnnn Sym links nnnnnnn Old files nnnnnnn Large files nnnn, nnn Graphics files nnnnnnn Executable files nnnnnnn Temporary files n, nnn, nnn TotalFileSize nnnn, nnn Introduction Lab 7 is nearly identical to Lab 2, except it is written in PowerShell, uses no UNIX/Linux tools to do its work, creates no...

  • This script will create a dictionary whose keys are all the directories listed in thePATH system...

    This script will create a dictionary whose keys are all the directories listed in thePATH system variable, and whose values are the number of files in each of these directories. The script will also print each directory entry sorted by directory name. The script will use the following five functions to get the required results get_environment_variable_value() get_dirs_from_path() get_file_count() get_file_count_for_dir_list() print_sorted_dictionary() get_environment_variable_value() The header for this function must be This function must accept a shell variable as its only parameter The...

  • Please complete the following: Write a Python script to do the following: 1. Ask the use...

    Please complete the following: Write a Python script to do the following: 1. Ask the use to enter several sentences, one at a time in a loop). To end the sentence entry, the user enters a blank (empty) sentence. 2. Extract each word from each sentence and put it in a list. This will require at least one loop to go through each sentence in the list. It is up to you how you want to get the words in...

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
ADVERTISEMENT