Skip to content

Commit

Permalink
Kleinere Bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
matze19999 authored Jan 1, 2020
1 parent 290ddb3 commit e8eac17
Show file tree
Hide file tree
Showing 2 changed files with 202 additions and 187 deletions.
10 changes: 6 additions & 4 deletions Get-OLCalendar.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ param (
[String]$mode="0"
)

Clear-Host

#Requires -Version 3.0
Function Get-OLCalendarItem {

Expand Down Expand Up @@ -51,13 +53,13 @@ $O | Out-File -FilePath .\events.csv -Append -Encoding 'utf8'

Function Set-OLCalendarItem {

# load the required .NET types
# Lade .NET types
Add-Type -AssemblyName 'Microsoft.Office.Interop.Outlook'

# access Outlook object model
# Greife auf Outlook Objekt Modell zu
$outlook = New-Object -ComObject outlook.application

# connect to the appropriate location
# Verbinde Outlook
$namespace = $outlook.GetNameSpace('MAPI')
$Calendar = [Microsoft.Office.Interop.Outlook.OlDefaultFolders]::olFolderCalendar
$folder = $namespace.getDefaultFolder($Calendar)
Expand Down Expand Up @@ -113,7 +115,7 @@ elseif($mode -eq "2"){
Set-OLCalendarItem
}
else{
Write-Host "Kein Parameter übergeben!"
Write-Host "Kein Parameter mitgegeben!"
}

Write-Host "Fertig!"
Loading

0 comments on commit e8eac17

Please sign in to comment.