Hello, there. I have no idea where to start with this assignment (Exercise 2; Step 1 – 9).
I hope somebody please helped me. (I know it is not a good way to learn Powershell to
ask this kind of question. But, I cannot help myself. I feel so embassrassed.
And I would like to understand how it works.
Thank you. Good evening.
———————————————————————————————————-
Exercise 2: Creating
the Win213 Repository – Using Conditional Control Structure
Commands
|
Purpose
|
||
<# #> |
Multiline comment
|
||
Clear-Host |
Clears the console
|
||
IF |
Tests of a condition
|
||
Get-Location |
Gets the current working directory
|
||
Set-Location |
Sets the current working directory
|
||
Pause
|
Suspends a script. Prompts user “Press Enter to continue”
|
||
Test-Path
|
Tests if a path is true of false
|
||
Write-Host
|
Displays message on console
|
script are listed above.In this exercise, we will use a conditional statement to check
whether the user is in the documents
folder, and if not, give him/her the chance to exit the script or continue.
Wk6Wk5Wk4Wk3Wk2Wk1
to a new tab. Name the file LearnName_Lab5_Win213Rep.ps1- Modify the Syntax to reflect that the user must be in the documents
folder to run the script - ##Create variables to store the documents, Win213,and Scripts folder
path
#############################################################################- Name the variables DocumentsPath, Win213Path, and ScriptsPath
- ##Create variables to hold the collection of folder names for Win213
folder and Scripts folder
##############################################################################- Separate each folder name with a comma (double quotes around each
name)
- Separate each folder name with a comma (double quotes around each
- ##Test if user in Documents folder, if not display message giving the
option to exit or ##continue,if continue change to documents folder and
make Win213 folder
##############################################################################- This is a common scripting technique you need to learn.
i.
Create a variable
to store the current prompt location
ii.
Use Test-Path
cmdlet to see if the current location is the same as the document path variable
you created in step 1. If it is, then
make the directory, if not display this message “"This script only runs in
the documents directory. Change to the documents directory and continue? Press
CTRL + C to exit or "
iii.
19486
43724
200
false
correct
Hello everyone, I'm a pretty good PowerShell scripter but I'm stuck on an issue that I cannot quite resolve. Here is my problem:
I have a PowerShell job that I want to resume after a computer reboot (This is a PowerShell workflow that I've suspended processing on so now I want to resume the job). To get the Powershell job to resume, I want to use a scheduled task and I've created the schedule task with PowerShell. I'm following the example in this blog article: http://blogs.msdn.com/b/powershell/archive/2013/12/23/automatically-resuming-windows-powershell-workflow-jobs-at-logon.aspx
Current behavior: after the computer reboot, the scheduled task won't execute. The schedule task executes successfully when I run it manually via GUI.
Desired behavior: have the powershell job resume after computer reboot using schedule task (I'm OK if there is some other method of getting the powershell job to resume…I think powershell schedule job module can do powershell job management but I couldn't find much information on it)
I'm seeking if someone could provide a powershell script for provisioning a scheduled task [I'm not sure if the issue is the powershell script itself or schedule task module not behaving properly]]>
—some other details
– I'm running W2012R2 (Azure virtual machine). Machine not joined on the domain.
-schedule task options: General > Security > Run whether user is logon or not; runs under Administrator; Triggers > On Startup
Thanks in advance for your assistance!