-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathEnable-OneNote.ps1
34 lines (26 loc) · 904 Bytes
/
Enable-OneNote.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
##
## This script "starts" the OneNote provider. You should call it every time you start
## powershell. It's a great candidate for including in your profile.
##
param([switch]$silent)
Set-StrictMode -Off
if ($args[0] -eq "-?")
{
Get-Content $(Get-Command Enable-OneNote.help.txt).Definition
return
}
function test-command ($commandName)
{
$error = $($commands = get-command $commandName) 2>&1
return $commands
}
$OneNoteHome = $(split-path $MyInvocation.MyCommand.Definition -parent)
write-verbose $OneNoteHome
if (!$silent -and $(test-command "Get-FileVersionInfo"))
{
write-verbose "Getting file version info for $OneNoteHome\*.dll"
Get-FileVersionInfo -Path "$OneNoteHome\*.dll" | format-table ProductName, FileVersion
}
Import-Module "$($OneNoteHome)\Microsoft.Office.OneNote.PowerShell.dll"
Update-FormatData "$($OneNoteHome)\OneNote.ps1xml"
$global:OneNoteHome = $OneNoteHome