Quantcast
Channel: SharePoint 2010 - General Discussions and Questions forum
Viewing all articles
Browse latest Browse all 17574

I am trying to see if a URL is valid in sharepoint or not using powershell please help!

$
0
0

Hi Everyone!

I am just trying to see if a picture already exists in my http://mysites/user Photos or not.

the basic part of the script I am trying to use is:

$url = "http://sps-dev-01/my/User%20Photos/Profile%20Pictures/" + $_.Name
$site = Get-SPWeb ($url)

Write-Host $url
    if ($web.Url.StartsWith($url))
    {
    Write-Host $_.Name "already exists"
 
 }else
 {

#put the picture up

}

Thanks in advance to anyone that can help!!


Best regards, Mike


Viewing all articles
Browse latest Browse all 17574

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>