Skip to content

Commit 826f9d0

Browse files
StartAutomatingStartAutomating
authored andcommitted
Add-OBSBrowserSource: Attempting local file fix (#34)
1 parent 5e12582 commit 826f9d0

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

Commands/Sources/Add-OBSBrowserSource.ps1

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,19 @@ dynamicParam {
135135
}
136136
if ($uri.Scheme -eq 'File') {
137137
if (Test-Path $uri.AbsolutePath) {
138-
$myParameterData["local_file"] = "$uri"
138+
$myParameterData["local_file"] = "$uri" -replace '[\\/]', '/'
139139
$myParameterData["is_local_file"] = $true
140140
}
141141
}
142142
else
143143
{
144-
$myParameterData["url"] = "$uri"
144+
if (Test-Path $uri) {
145+
$rp = $ExecutionContext.SessionState.Path.GetResolvedPSPathFromPSPath($uri)
146+
$myParameterData["local_file"] = "$rp" -replace '[\\/]', '/'
147+
$myParameterData["is_local_file"] = $true
148+
} else {
149+
$myParameterData["url"] = "$uri"
150+
}
145151
}
146152

147153
if (-not $Name) {

0 commit comments

Comments
 (0)