Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
a90585d
get-azureautomationschedule implementation and unit tests
elvg Dec 11, 2014
73a750a
Runbook cmdlet get
safeermohammed Dec 15, 2014
35edea9
swapping byall and byfrom
safeermohammed Dec 16, 2014
acc3cda
2 cmdlets for variables
kiranisaac Dec 19, 2014
85c7220
Saving Runbook cmdlets
safeermohammed Dec 19, 2014
836e859
schedule automation cmdlets, unit tests and infrastructure for automa…
elvg Dec 19, 2014
6b951a3
job stream cmdlet
kiranisaac Dec 19, 2014
c442201
merge with elvg
kiranisaac Dec 19, 2014
919256b
cmdlets + tests
mohanishpenta Dec 31, 2014
4da0efc
piping
kiranisaac Dec 31, 2014
68dbb3b
operation excpetion from mpenta
kiranisaac Dec 31, 2014
0f3ea14
rename the functions and add basic unit test files
kiranisaac Dec 31, 2014
b29bf88
update code to use list operation
kiranisaac Dec 31, 2014
372d3dd
Merge pull request #1 from kiranisaac/master
kiranisaac Dec 31, 2014
e4e7ad5
Saving runbook cmdlet changes
safeermohammed Jan 2, 2015
fd7437f
Merge branch 'dev' of https://github.com/elvg/azure-powershell
safeermohammed Jan 2, 2015
f4392ef
schedule cmdlets code is refactored
elvg Jan 5, 2015
0ad4028
Merging with Safeer
elvg Jan 5, 2015
0d5ea48
Start runbook implementation + Unit test
safeermohammed Jan 5, 2015
3570e5e
check for new properties
safeermohammed Jan 6, 2015
cc59a41
Merge branch 'dev' of https://github.com/elvg/azure-powershell
safeermohammed Jan 6, 2015
3726c7e
AUtomation PS cmdlets: JobSchedules
elvg Jan 7, 2015
2b550ec
updated job and joboutput to use id instead of name
kiranisaac Jan 7, 2015
fa06234
added unit testsfor Job cmdlets, code review comments for modules
mohanishpenta Jan 8, 2015
a2e2633
updating job schedule cmdlets
elvg Jan 8, 2015
49d22b8
fixing conflicts
elvg Jan 8, 2015
db080d8
merge with mpenta
kiranisaac Jan 8, 2015
dc51793
fixed and added unit tests for jobs
mohanishpenta Jan 8, 2015
ba3eab7
Accounts implementation
safeermohammed Jan 8, 2015
0078dbf
merged with mpenta and elvg - the unit test project has been disabled…
kiranisaac Jan 8, 2015
84b5503
Merge branch 'master' of https://github.com/mohanishpenta/azure-power…
kiranisaac Jan 8, 2015
581a82a
merged with mpenta - fix for broken unit test project
kiranisaac Jan 8, 2015
183beb1
Merge pull request #4 from kiranisaac/master
kiranisaac Jan 8, 2015
a6d4139
Merge branch 'dev' of https://github.com/Azure/azure-powershell into …
elvg Jan 9, 2015
20ef290
Saving accounts work
safeermohammed Jan 10, 2015
9f23916
Saving Accounts after Merge
safeermohammed Jan 10, 2015
adb7dd7
renaming some parameters of jobschedule cmdlets
elvg Jan 13, 2015
06b8c89
Remove Accounts update and Certificate cmdlets
safeermohammed Jan 17, 2015
9d8f3b5
refactoring automation ps cmdlets
elvg Jan 20, 2015
7c9566c
Updating Variables to match the new spec
kiranisaac Jan 20, 2015
5feb630
Merge branch 'dev' of https://github.com/elvg/azure-powershell
kiranisaac Jan 20, 2015
5b0e2c0
fix broken test - merge with elvg
kiranisaac Jan 21, 2015
67523d6
Saving change before pull from Elvan dev
safeermohammed Jan 21, 2015
972f6cf
saving work
safeermohammed Jan 21, 2015
8e66b0e
fixed pr comments from elvg
kiranisaac Jan 22, 2015
b5625c3
Certificate cmdlets
safeermohammed Jan 22, 2015
bbb5059
module changes, code review changes for Job resource, cerdential)
mohanishpenta Jan 23, 2015
9c7f3e9
merged a conflict
mohanishpenta Jan 23, 2015
90e411f
added alias on Tags, changed the output return object
mohanishpenta Jan 24, 2015
15daba3
resolve conflicts with commit for certificates
kiranisaac Jan 24, 2015
9717ed0
Merge pull request #6 from mohanishpenta/master
kiranisaac Jan 24, 2015
2d45d32
Merge pull request #5 from kiranisaac/master
kiranisaac Jan 24, 2015
b671ca1
saving changes before pull
safeermohammed Jan 25, 2015
33b02f7
saving changes before pull
safeermohammed Jan 25, 2015
f08a2f0
Merge branch 'dev' of https://github.com/elvg/azure-powershell
safeermohammed Jan 25, 2015
e4e5e42
mergin with azure-powershell
elvg Jan 26, 2015
afc67b0
Merge branch 'dev' of https://github.com/elvg/azure-powershell into dev3
elvg Jan 26, 2015
115012f
Saving Connections work
safeermohammed Jan 26, 2015
729257f
Saving Connections work - add missing change
safeermohammed Jan 26, 2015
7c34a3b
Connections by connection type
safeermohammed Jan 27, 2015
a496c36
fix deserialization of array variables
kiranisaac Jan 27, 2015
9c5b928
Merge branch 'dev' of https://github.com/elvg/azure-powershell into dev3
elvg Jan 28, 2015
051136f
Addressing feedback
safeermohammed Jan 28, 2015
8d50775
Changing the stream id
elvg Jan 28, 2015
2cd218d
merging the latest changes
elvg Jan 28, 2015
8f997db
change function name from decrypt to deserialize
kiranisaac Jan 28, 2015
bc4966d
merge with elvg and resolve conflicts
kiranisaac Jan 28, 2015
b026b1b
Merge pull request #7 from kiranisaac/master
elvg Jan 29, 2015
1bbecef
Merge branch 'dev' of https://github.com/Azure/azure-powershell into …
elvg Jan 29, 2015
3a11633
Powershell bug fixes
safeermohammed Feb 2, 2015
3f57ac0
Merge branch 'dev' of https://github.com/elvg/azure-powershell into dev3
elvg Feb 2, 2015
04a9233
use ConvertTo-Json instead of Newtonsoft
kiranisaac Feb 3, 2015
bb88b49
Merge pull request #8 from kiranisaac/master
kiranisaac Feb 3, 2015
8789745
JobScheduleParameters and JobParameters should return Dictionary<stri…
kiranisaac Feb 4, 2015
40eb816
bug fixes for pipelining of runbook to get job schedules and for upda…
elvg Feb 4, 2015
79497e5
Merge branch 'dev' of https://github.com/elvg/azure-powershell into dev3
elvg Feb 4, 2015
3876af9
Merge pull request #9 from kiranisaac/master
elvg Feb 4, 2015
18a5516
Merge branch 'dev' of https://github.com/elvg/azure-powershell into dev3
elvg Feb 4, 2015
dad48ec
Removed Type in Runbook and Module
safeermohammed Feb 4, 2015
759cf6e
bu fix with get-azureautomationscheduledrunbook
elvg Feb 4, 2015
e5da677
Merge branch 'dev' of https://github.com/elvg/azure-powershell
safeermohammed Feb 4, 2015
816f665
merge encrypted variables with variables
kiranisaac Feb 4, 2015
e514036
Merge branch 'dev' of https://github.com/elvg/azure-powershell
kiranisaac Feb 4, 2015
3a084d9
Merge pull request #10 from kiranisaac/master
elvg Feb 4, 2015
ad5f320
Module Bug fixes
safeermohammed Feb 4, 2015
c5440bc
Hastable changes
safeermohammed Feb 5, 2015
868481c
test and hashtable
safeermohammed Feb 5, 2015
eaaf216
updating the scenario tests
elvg Feb 5, 2015
3e895d1
test changes
safeermohammed Feb 5, 2015
f0db1ff
Merge branch 'dev' of https://github.com/Azure/azure-powershell into …
elvg Feb 6, 2015
cea9420
reverting the automation MAML to an older version
elvg Feb 6, 2015
2d9b130
Tags to string[] and namespace changes in cmdlets
safeermohammed Feb 7, 2015
c12e545
Project file
safeermohammed Feb 7, 2015
634abe9
Hashtable
safeermohammed Feb 7, 2015
5858d1b
UnitTest changes for Tags
safeermohammed Feb 7, 2015
d39de0b
wxi change for SDK DLL
safeermohammed Feb 7, 2015
e1a151c
Latest Pull
safeermohammed Feb 7, 2015
d39fac6
wxi change for Automation SDK DLL name change
safeermohammed Feb 7, 2015
a99504a
Removed JobStartedByParameterName value in output
safeermohammed Feb 7, 2015
ed198df
fixing merge conflicts
elvg Feb 8, 2015
9ac1471
StreamType should be enum + unit test figured
kiranisaac Feb 9, 2015
aa06c8e
Merge pull request #11 from kiranisaac/master
elvg Feb 9, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion setup/azurecmdfiles.wxi
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@
<File Id="filD8D1F471ACDC72E34B1D13DA591F7B3F" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Automation\Microsoft.Azure.Common.NetFramework.dll" />
</Component>
<Component Id="cmp4EC3226B54BFE0FF4970968ABD1746E3" Guid="*">
<File Id="filBEF499CCE9B33E61EA5BEFE2BEE86E92" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Automation\Microsoft.Azure.Management.Automation.dll" />
<File Id="filBEF499CCE9B33E61EA5BEFE2BEE86E92" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Automation\Microsoft.WindowsAzure.Management.Automation.dll" />
</Component>
<Component Id="cmp86A3FC330AB128431B87D9FC2A1D3109" Guid="*">
<File Id="fil08829B0CC57BEE7E650F0AE7867D27EE" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Automation\Microsoft.Azure.ResourceManager.dll" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
Checks whether the first string contains the second one
#>

$accountName='AutomationAccount'
$accountName='safeer'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: it's little bit awkward to have account name with a real person. Maybe automatedAccount is better?`

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for catching this but we would like to change it in next release.

$location = "East US"

function AssertContains
{
Expand Down Expand Up @@ -108,10 +109,10 @@ function Test-RunbookWithParameter

$runbook = CreateRunbook $runbookPath
Assert-NotNull $runbook "runBook $runbookPath does not import successfully."
$automationAccount | Publish-AzureAutomationRunbook -Id $runbook.Id
$automationAccount | Publish-AzureAutomationRunbook -Name $runbook.Name

#Test
$job = $automationAccount | Start-AzureAutomationRunbook -Id $runbook.Id -Parameters $parameters
$job = $automationAccount | Start-AzureAutomationRunbook -Name $runbook.Name -Parameters $parameters
WaitForJobStatus -Id $job.Id -Status "Completed"
$jobOutput = $automationAccount | Get-AzureAutomationJobOutput -Id $job.Id -Stream Output
$automationAccount | Remove-AzureAutomationRunbook -Name $runbook.Name -Force
Expand All @@ -126,16 +127,15 @@ function Test-AutomationStartAndStopRunbook
{
param([string] $runbookPath)

#Setup
$automationAccount = Get-AzureAutomationAccount -Name $accountName
$automationAccount = Get-AzureAutomationAccount -Name $accountName
Assert-NotNull $automationAccount "Automation account $accountName does not exist."

$runbook = CreateRunbook $runbookPath
Assert-NotNull $runbook "runBook $runbookPath does not import successfully."
$automationAccount | Publish-AzureAutomationRunbook -Id $runbook.Id
$automationAccount | Publish-AzureAutomationRunbook -Name $runbook.Name

#Test
$job = $automationAccount | Start-AzureAutomationRunbook -Id $runbook.Id
$job = Start-AzureAutomationRunbook -Name $runbook.Name -AutomationAccountName $accountName
WaitForJobStatus -Id $job.Id -Status "Running"
$automationAccount | Stop-AzureAutomationJob -Id $job.Id
WaitForJobStatus -Id $job.Id -Status "Stopped"
Expand All @@ -153,31 +153,28 @@ function Test-AutomationPublishAndEditRunbook

$runbook = CreateRunbook $runbookPath $true

#Test

Assert-Null $runbook.PublishedRunbookVersionId
Assert-NotNull $runbook.DraftRunbookVersionId
#Publish Runbook
$publishedRunbook = Publish-AzureAutomationRunbook $accountName -Id $runbook.Id
Assert-NotNull $publishedRunbook.PublishedRunbookVersionId
Assert-Null $publishedRunbook.DraftRunbookVersionId
$publishedRunbookDefn = Get-AzureAutomationRunbookDefinition $accountName -VersionId $publishedRunbook.PublishedRunbookVersionId
Publish-AzureAutomationRunbook $accountName -Name $runbook.Name
$publishedRunbook = Get-AzureAutomationRunbook $accountName -Name $runbook.Name
$runbookState = "Published"
Assert-AreEqual $publishedRunbook.State $runbookState "Runbook should be in $runbookState state"
$publishedRunbookDefn = Get-AzureAutomationRunbookDefinition $accountName -Name $runbook.Name

#Edit Runbook
Set-AzureAutomationRunbookDefinition $accountName -Id $runbook.Id -Path $runbookPath -Overwrite
Set-AzureAutomationRunbookDefinition $accountName -Name $runbook.Name -Path $runbookPath -Overwrite
$runbook = Get-AzureAutomationRunbook $accountName -Name $runbook.Name
Assert-AreEqual $publishedRunbook.PublishedRunbookVersionId $runbook.PublishedRunbookVersionId
Assert-NotNull $runbook.DraftRunbookVersionId "Runbook should be in draft mode"
$editedRunbookDefn = Get-AzureAutomationRunbookDefinition $accountName -VersionId $runbook.DraftRunbookVersionId
$runbookState = "Edit"
Assert-AreEqual $runbook.State $runbookState "Runbook should be in $runbookState state"
$editedRunbookDefn = Get-AzureAutomationRunbookDefinition $accountName -Name $runbook.Name -Slot "Draft"
Assert-AreNotEqual $editedRunbookDefn.Content $publishedRunbookDefn.Content "Old content and edited content of the runbook shouldn't be equal"

Assert-Throws {Set-AzureAutomationRunbookDefinition $accountName -Name $runbook.Name -Path $editRunbookPath -PassThru -ErrorAction Stop}
Set-AzureAutomationRunbookDefinition $accountName -Name $runbook.Name -Path $editRunbookPath -Overwrite
$editedRunbookDefn2 = Get-AzureAutomationRunbookDefinition $accountName -VersionId $runbook.DraftRunbookVersionId
$editedRunbookDefn2 = Get-AzureAutomationRunbookDefinition $accountName -Name $runbook.Name -Slot "Draft"
Assert-AreNotEqual $editedRunbookDefn2.Content $editedRunbookDefn.Content "Old content and edited content of the runbook shouldn't be equal"

Remove-AzureAutomationRunbook $accountName -Id $runbook.Id -Force
Assert-Throws {Get-AzureAutomationRunbook $accountName -Id $runbook.Id}
Remove-AzureAutomationRunbook $accountName -Name $runbook.Name -Force
Assert-Throws {Get-AzureAutomationRunbook $accountName -Name $runbook.Name}

}

Expand All @@ -194,30 +191,26 @@ function Test-AutomationConfigureRunbook
Assert-NotNull $automationAccount "Automation account $accountName does not exist."
$runbook = CreateRunbook $runbookPath
Assert-NotNull $runbook "runbook ($runbookPath) isn't imported successfully."
Publish-AzureAutomationRunbook -Id $runbook.Id -AutomationAccountName $accountName
Publish-AzureAutomationRunbook -Name $runbook.Name -AutomationAccountName $accountName

#Test

#Change the runbook configuration
$automationAccount | Set-AzureAutomationRunbook -Id $runbook.Id -LogDebug $true -LogVerbose $true -LogProgress $false
$automationAccount | Set-AzureAutomationRunbook -Name $runbook.Name -LogVerbose $true -LogProgress $false
$runbook = $automationAccount | Get-AzureAutomationRunbook -Name $runbook.Name
Assert-NotNull $runbook "Runbook shouldn't be Null"
Assert-AreEqual $true $runbook.LogDebug "Log Debug mode should be true."
Assert-AreEqual $true $runbook.LogVerbose "Log Verbose mode should be true."
Assert-AreEqual $false $runbook.LogProgress "Log Progress mode should be false."

#Start runbook and wait for job complete
$job = $automationAccount | Start-AzureAutomationRunbook -Id $runbook.Id
$job = $automationAccount | Start-AzureAutomationRunbook -Name $runbook.Name
WaitForJobStatus -Id $job.Id -Status "Completed"

#Check job output streams
$jobOutputs = $automationAccount | Get-AzureAutomationJobOutput -Id $job.Id -Stream "Output"
Assert-AreEqual 1 $jobOutputs.Count
AssertContains $jobOutputs[0].Text "output message" "The output stream is wrong."
#Verify that debug and verbose streams are logged
$jobDebugOutputs = $automationAccount | Get-AzureAutomationJobOutput -Id $job.Id -Stream "Debug"
Assert-AreEqual 1 $jobDebugOutputs.Count
AssertContains $jobDebugOutputs[0].Text "debug message" "The debug stream is wrong."
#Verify that verbose streams are logged
$jobVerboseOutputs = Get-AzureAutomationJobOutput $accountName -Id $job.Id -Stream "Verbose"
Assert-AreEqual 1 $jobVerboseOutputs.Count
AssertContains $jobVerboseOutputs[0].Text "verbose message" "The verbose stream is wrong."
Expand All @@ -226,26 +219,24 @@ function Test-AutomationConfigureRunbook
Assert-AreEqual 0 $jobProgressOutputs.Count

#Change the runbook configuration again and start the runbook
Set-AzureAutomationRunbook $accountName -Id $runbook.Id -LogDebug $false -LogVerbose $false -LogProgress $true
Set-AzureAutomationRunbook $accountName -Name $runbook.Name -LogVerbose $false -LogProgress $true
$job = Start-AzureAutomationRunbook $accountName -Name $runbook.Name
WaitForJobStatus -Id $job.Id -Status "Completed"
#Verify that progress stream is logged
$jobProgressOutputs = Get-AzureAutomationJobOutput $accountName -Id $job.Id -Stream "Progress"
Assert-AreNotEqual 0 $jobProgressOutputs.Count
Assert-AreEqual $jobProgressOutputs[0].Type "Progress"
#Verify that debug and verbose streams aren't logged
$jobDebugOutputs = Get-AzureAutomationJobOutput $accountName -Id $job.Id -Stream "Debug"
Assert-AreEqual 0 $jobDebugOutputs.Count
#Verify that verbose streams aren't logged
$jobVerboseOutputs = Get-AzureAutomationJobOutput $accountName -Id $job.Id -Stream "Verbose"
Assert-AreEqual 0 $jobVerboseOutputs.Count

#Check whether the total number of jobs for the runbook is correct
$jobs = Get-AzureAutomationJob $accountName -RunbookId $runbook.Id
$jobs = Get-AzureAutomationJob $accountName -RunbookName $runbook.Name
Assert-AreEqual 2 $jobs.Count "There should be 2 jobs in total for this runbook."

#Remove runbook
$automationAccount | Remove-AzureAutomationRunbook -Name $runbook.Name -Force
Assert-Throws {$automationAccount | Get-AzureAutomationRunbook -Id $runbook.Id}
Assert-Throws {$automationAccount | Get-AzureAutomationRunbook -Name $runbook.Name}
}

<#
Expand All @@ -263,17 +254,17 @@ function Test-AutomationSuspendAndResumeJob

#Test

$automationAccount | Publish-AzureAutomationRunbook -Id $runbook.Id
$automationAccount | Publish-AzureAutomationRunbook -Name $runbook.Name
#Start, suspend, and then resume job
$job = Start-AzureAutomationRunbook $accountName -Id $runbook.Id
$job = Start-AzureAutomationRunbook $accountName -Name $runbook.Name
WaitForJobStatus -Id $job.Id -Status "Running"
Suspend-AzureAutomationJob $accountName -Id $job.Id
WaitForJobStatus -Id $job.Id -Status "Suspended"
$automationAccount | Resume-AzureAutomationJob -Id $job.Id
WaitForJobStatus -Id $job.Id -Status "Completed"

#Remove runbook
Remove-AzureAutomationRunbook -AutomationAccountName $accountName -Id $runbook.Id -Force
Remove-AzureAutomationRunbook -AutomationAccountName $accountName -Name $runbook.Name -Force
Assert-Throws {Get-AzureAutomationRunbook $accountName -Name $runbook.Name}
}

Expand Down Expand Up @@ -319,31 +310,34 @@ function Test-AutomationStartRunbookOnASchedule

$runbook = Register-AzureAutomationScheduledRunbook $accountName -Name $runbook.Name -ScheduleName $oneTimeScheName
Assert-AreEqual $oneTimeScheName $runbook.ScheduleNames "The runbook should be associated with $oneTimeScheName"
$runbook = Register-AzureAutomationScheduledRunbook $accountName -Id $runbook.Id -ScheduleName $dailyScheName
$runbook = Register-AzureAutomationScheduledRunbook $accountName -Name $runbook.Name -ScheduleName $dailyScheName
Assert-True { $runbook.ScheduleNames -Contains $dailyScheName} "The runbook should be associated with $dailyScheName"

#waiting for seven minutes
Wait-Seconds 420
$job = Get-AzureAutomationJob $accountName -RunbookId $runbook.Id | where {$_.ScheduleName -eq $oneTimeScheName}
$job = Get-AzureAutomationJob $accountName -Name $runbook.Name | where {$_.ScheduleName -eq $oneTimeScheName}
$jobSchedule = Get-AzureAutomationScheduledRunbook $accountName -RunbookName $runbook.Name -ScheduleName $oneTimeScheName
Assert-AreEqual 1 $jobSchedule.Count
Assert-AreEqual 1 $job.Count
WaitForJobStatus -Id $job.Id -Status "Completed"

#Edit schedule
$description = "Daily Schedule Description"
Set-AzureAutomationSchedule $accountName -Name $oneTimeScheName -Description $description
$dailySchedule = Get-AzureAutomationSchedule $accountName -Name $oneTimeScheName
Set-AzureAutomationSchedule $accountName -Name $dailyScheName -Description $description
$dailySchedule = Get-AzureAutomationSchedule $accountName -Name $dailyScheName
Assert-AreEqual $description $dailySchedule.Description

$runbook = Unregister-AzureAutomationScheduledRunbook $accountName -Name $runbook.Name -ScheduleName $dailyScheName
Assert-False {$runbook.ScheduleNames -Contains $dailyScheName} "The runbook shouldn't have an association with $dailyScheName"
Unregister-AzureAutomationScheduledRunbook $accountName -Name $runbook.Name -ScheduleName $dailyScheName
$jobSchedule = Get-AzureAutomationScheduledRunbook $accountName -RunbookName $runbook.Name -ScheduleName $dailyScheName
Assert-Null $jobSchedule "The runbook shouldn't have an association with $dailyScheName"

#Remove runbook and schedule
Remove-AzureAutomationSchedule $accountName -Name $oneTimeScheName -Force
Assert-Throws {$automationAccount | Get-AzureAutomationSchedule -Name $oneTimeScheName}
$automationAccount | Remove-AzureAutomationSchedule -Name $dailyScheName -Force
Assert-Throws {$automationAccount | Get-AzureAutomationSchedule -Name $dailyScheName}
Remove-AzureAutomationRunbook $accountName -Id $runbook.Id -Force
Assert-Throws {Get-AzureAutomationRunbook $accountName -Id $runbook.Id}
Remove-AzureAutomationRunbook $accountName -Name $runbook.Name -Force
Assert-Throws {Get-AzureAutomationRunbook $accountName -Name $runbook.Name}
}

<#
Expand All @@ -362,8 +356,8 @@ function Test-AutomationStartUnpublishedRunbook
Assert-NotNull $runbook "runBook $runbookPath does not import successfully."
Assert-NotNull $runbook.Tags "Tags of the runbook shouldn't be Null."
Assert-NotNull $runbook.Description "Description of the runbook shouldn't be Null."
Assert-Throws {Start-AzureAutomationRunbook $accountName -Id $runbook.Id -Parameters $runbookParameters -PassThru -ErrorAction Stop}
Assert-Throws {Start-AzureAutomationRunbook $accountName -Name $runbook.Name -Parameters $runbookParameters -PassThru -ErrorAction Stop}

Remove-AzureAutomationRunbook $accountName -Id $runbook.Id -Force
Assert-Throws {Get-AzureAutomationRunbook $accountName -Id $runbook.Id -Parameters $runbookParameters -PassThru -ErrorAction Stop}
Remove-AzureAutomationRunbook $accountName -Name $runbook.Name -Force
Assert-Throws {Get-AzureAutomationRunbook $accountName -Name $runbook.Name -Parameters $runbookParameters -PassThru -ErrorAction Stop}
}
Original file line number Diff line number Diff line change
Expand Up @@ -111,25 +111,42 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="UnitTests\GetAzureAutomationConnectionTest.cs" />
<Compile Include="UnitTests\GetAzureAutomationCertificateTest.cs" />
<Compile Include="UnitTests\NewAzureAutomationAccountTest.cs" />
<Compile Include="UnitTests\GetAzureAutomationAccountTest.cs" />
<Compile Include="UnitTests\GetAzureAutomationJobOutputTest.cs" />
<Compile Include="UnitTests\GetAzureAutomationJobTest.cs" />
<Compile Include="UnitTests\GetAzureAutomationRunbookDefinitionTest.cs" />
<Compile Include="UnitTests\GetAzureAutomationRunbookTest.cs" />
<Compile Include="UnitTests\GetAzureAutomationScheduleTest.cs" />
<Compile Include="UnitTests\GetAzureAutomationScheduledRunbookTest.cs" />
<Compile Include="UnitTests\NewAzureAutomationConnectionTest.cs" />
<Compile Include="UnitTests\NewAzureAutomationCertificateTest.cs" />
<Compile Include="UnitTests\NewAzureAutomationRunbookTest.cs" />
<Compile Include="UnitTests\NewAzureAutomationScheduleTest.cs" />
<Compile Include="UnitTests\PublishAzureAutomationRunbookTest.cs" />
<Compile Include="UnitTests\RegisterAzureAutomationScheduledJobTest.cs" />
<Compile Include="UnitTests\RemoveAzureAutomationAccountTest.cs" />
<Compile Include="UnitTests\RemoveAzureAutomationConnectionTest.cs" />
<Compile Include="UnitTests\RemoveAzureAutomationCertificateTest.cs" />
<Compile Include="UnitTests\RegisterAzureAutomationScheduledRunbookTest.cs" />
<Compile Include="UnitTests\RemoveAzureAutomationRunbookTest.cs" />
<Compile Include="UnitTests\RemoveAzureAutomationScheduleTest.cs" />
<Compile Include="UnitTests\ResumeAzureAutomationJobTest.cs" />
<Compile Include="UnitTests\SetAzureAutomationRunbookDefinitionTest.cs" />
<Compile Include="UnitTests\SetAzureAutomationRunbookTest.cs" />
<Compile Include="UnitTests\GetAzureAutomationCredentialTest.cs" />
<Compile Include="UnitTests\GetAzureAutomationJobTest.cs" />
<Compile Include="UnitTests\GetAzureAutomationModuleTest.cs" />
<Compile Include="UnitTests\GetAzureAutomationScheduleTest.cs" />
<Compile Include="UnitTests\NewAzureAutomationCredentialTest.cs" />
<Compile Include="UnitTests\NewAzureAutomationModuleTest.cs" />
<Compile Include="UnitTests\NewAzureAutomationScheduleTest.cs" />
<Compile Include="UnitTests\NewAzureAutomationVariableTest.cs" />
<Compile Include="UnitTests\RemoveAzureAutomationModuleTest.cs" />
<Compile Include="UnitTests\RemoveAzureAutomationScheduleTest.cs" />
<Compile Include="UnitTests\RemoveAzureAutomationVariableTest.cs" />
<Compile Include="UnitTests\GetAzureAutomationVariableTest.cs" />
<Compile Include="UnitTests\ResumeAzureAutomationJobTest.cs" />
<Compile Include="UnitTests\SetAzureAutomationCredentialTest.cs" />
<Compile Include="UnitTests\SetAzureAutomationScheduleTest.cs" />
<Compile Include="UnitTests\StartAzureAutomationRunbookTest.cs" />
<Compile Include="UnitTests\StopAzureAutomationJobTest.cs" />
<Compile Include="UnitTests\SuspendAzureAutomationJobTest.cs" />
<Compile Include="UnitTests\StartAzureAutomationRunbookTest.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Common\Commands.Common.Test\Commands.Common.Test.csproj">
Expand All @@ -148,6 +165,7 @@
<ItemGroup>
<None Include="MSSharedLibKey.snk" />
<None Include="packages.config" />
<Compile Include="UnitTests\UnregisterAzureAutomationScheduledRunbookTest.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
Expand Down
Loading