plugins/qod/Load.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
$PreLoad = {
    if (-not (Test-OMPProfileSetting -Name 'QuoteDirectory')) {
        $QuoteDir = Join-Path $PluginPath "$Name\src\quotes.txt"
        Write-Output "Setting Quote Directory to $QuoteDir"
        Add-OMPProfileSetting -Name 'QuoteDirectory' -Value $QuoteDir
        Export-OMPProfile
    }
    $QuoteDir = Get-OMPProfileSetting -Name 'QuoteDirectory'
}
$Config = {}
$PostLoad = {
    Write-Host ''
    Write-Host (Get-Quote -Path $QuoteDir)
}
$Shutdown = {}
$Unload = {
    Remove-OMPProfileSetting -Name 'QuoteDirectory'
}