I'm relatively new to PowerShell and getting my head around a script i am modifying for my environment.
Simply put, I need to add a URL as a variable to my script, but there is a space in it. I have tried replacing the space with a '%20' but it still doesn't resolve.
$WebUrl = "http://sharepoint.acceptance/xxx/xxx/xxx/xxx/xxx/Workflow History/"
and
$WebUrl = "http://sharepoint.acceptance/xxx/xxx/xxx/xxx/xxx/Workflow%20History/"
when validated with
$Web = Get-SPWeb $WebUrl -ea SilentlyContinue
if($Web -eq $null)
{
Write-Error "The web with URL '$WebUrl' was not found, halting execution."
break
}
else {
write-host "$WebUrl is good"
}
both return
"The web with URL 'http://sharepoint.acceptance/xxx/xxx/xxx/xxx/xxx/Workflow%20History/' was not found, halting execution."
in each case. I'm sure what I am doing is just a matter of bad syntax but I'm just not experienced enough to see the issue.