function Load-Assembly
{
<#
.SYNOPSIS
Check if a assembly is loaded and load it if necessary
.DESCRIPTION
The script will check if an assembly is already loaded.
If it isn't already loaded it will try to load the assembly
.PARAMETER name
Full name of the assembly to be loaded
.EXAMPLE
Load-Assembly -name 'Microsoft.SqlServer.SMO'
.INPUTS
.OUTPUTS
.NOTES
.LINK
#>
param(
[Parameter(Mandatory = $true)][ValidateNotNullOrEmpty()]
[String] $name
)
if(([System.AppDomain]::Currentdomain.GetAssemblies() | where {$_ -match $name}) -eq $null)
{
try{
[System.Reflection.Assembly]::LoadWithPartialName($name) | Out-Null
}
catch [System.Exception]
{
Write-Host "Failed to load assembly!" -ForegroundColor Red
Write-Host "$_.Exception.GetType().FullName, $_.Exception.Message" -ForegroundColor Red
}
}
}
function Load-Assembly
{
<#
.SYNOPSIS
Check if a assembly is loaded and load it if necessary
.DESCRIPTION
The script will check if an assembly is already loaded.
If it isn't already loaded it will try to load the assembly
.PARAMETER name
Full name of the assembly to be loaded
.EXAMPLE
Load-Assembly -name 'Microsoft.SqlServer.SMO'
.INPUTS
.OUTPUTS
.NOTES
.LINK
#>
param(
[Parameter(Mandatory = $true)][ValidateNotNullOrEmpty()]
[String] $name
)
if(([System.AppDomain]::Currentdomain.GetAssemblies() | where {$_ -match $name}) -eq $null)
{
try{
[System.Reflection.Assembly]::LoadWithPartialName($name) | Out-Null
}
catch [System.Exception]
{
Write-Host "Failed to load assembly!" -ForegroundColor Red
Write-Host "$_.Exception.GetType().FullName, $_.Exception.Message" -ForegroundColor Red
}
}
}
status | not learned | measured difficulty | 37% [default] | last interval [days] | |||
---|---|---|---|---|---|---|---|
repetition number in this series | 0 | memorised on | scheduled repetition | ||||
scheduled repetition interval | last repetition or drill |