-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathCodeConversion.psm1
33 lines (29 loc) · 1005 Bytes
/
CodeConversion.psm1
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
if ($IsLinux) {
$Folder = Join-Path $PSScriptRoot "linux-64"
$Path = Join-Path $Folder "CodeConversion"
}
else {
$Folder = Join-Path $PSScriptRoot "win7-x64"
$Path = Join-Path $Folder "CodeConversion.exe"
}
function Invoke-CodeConversion {
param(
[Parameter(Mandatory, Position = 0, ParameterSetName = "File")]
[string]$InputFile,
[Parameter(Mandatory, Position = 1, ParameterSetName = "File")]
[string]$OutputFile,
[Parameter(Mandatory, Position = 0, ParameterSetName = "CSharp")]
[string]$CSharp,
[Parameter(Mandatory, Position = 0, ParameterSetName = "PowerShell")]
[string]$PowerShell
)
if ($PSCmdlet.ParameterSetName -eq 'File') {
& $Path --InputFile $InputFile --OutputPath $OutputFile
}
elseif ($PSCmdlet.ParameterSetName -eq 'PowerShell') {
& $Path --PowerShell $PowerShell
}
elseif ($PSCmdlet.ParameterSetName -eq 'CSharp') {
& $Path --CSharp $CSharp
}
}