Question: When having different codebases how would I share code between them.
All code is in typescript and in continuous development.

I am looking for a simple solution.

Things I have tried:

1 using import statement with path to other project:
----------------------------------------------------

```
import { type } from '../../otherProj/src/type';

```

does not work:

```
error TS2307: Cannot find module '../../otherProj/src/type'

```

2 npm module
------------

Installed locally using

```
npm i ../otherProj

```

Is problematic as I always have to update the version of the library on each change or I have to manually uninstall / reinstall the library.

3 git submodule / subtree
-------------------------

Using a git submodule.

4 Softlink / Directory Junction
-------------------------------

As we are on Windows we are right now using the `mklink /D /J`

Are there any other alternatives?

Answer: 
Looks like there are no built-in methods, but if you're willing to use third-party binary, [wkhtmltopdf](https://wkhtmltopdf.org/) can be used.

1. Get [precompiled binary](https://wkhtmltopdf.org/downloads.html) (use MinGW 32-bit for maximum compatibility).
2. Install or extract installer with 7Zip and copy `wkhtmltopdf.exe` to your script directory. It has no external dependencies and can be redistributed with your script, so you don't have to install PDF printer on all PCs.
3. Use [HTMLBody](https://msdn.microsoft.com/en-us/library/office/ff868941.aspx) property of `MailItem` object in your script for PDF conversion.

Here is an example:

```
# Get path to wkhtmltopdf.exe
$ExePath = Join-Path -Path (
    Split-Path -Path $Script:MyInvocation.MyCommand.Path
) -ChildPath 'wkhtmltopdf.exe'

# Set PDF path
$OutFile = Join-Path -Path 'c:\path\to\emails' -ChildPath ($Email.Subject + '.pdf')

# Convert HTML string to PDF file
$ret = $Email.HTMLBody | & $ExePath @('--quiet', '-', $OutFile) 2>&1

# Check for errors
if ($LASTEXITCODE) {
    Write-Error $ret
}

```

Please note, that I've no experience with Outlook and used MSDN to get relevant properties for object, so the code might need some tweaking.
Had this same issue. This is what I did to fix it if anybody else is trying to do something similar.

You could start by taking your msg file and converting it to doc then converting the doc file to pdf. 

```
$outlook = New-Object -ComObject Outlook.Application
$word = New-Object -ComObject Word.Application

Get-ChildItem -Path $folderPath -Filter *.msg? | ForEach-Object {

    $msgFullName = $_.FullName
    $docFullName = $msgFullName -replace '\.msg$', '.doc'
    $pdfFullName = $msgFullName -replace '\.msg$', '.pdf'

    $msg = $outlook.CreateItemFromTemplate($msgFullName)
    $msg.SaveAs($docFullName, 4)

    $doc = $word.Documents.Open($docFullName)
    $doc.SaveAs([ref] $pdfFullName, [ref] 17)

    $doc.Close()
 }

```

Then, just clean up the unwanted files after