Tag: path
-
PowerShell Upload File to Style Library & Sub-Path Location
function UploadFile2StyleLibraryLocation($WebUrl, [String] $SourceFilePath, [String] $StyleLibrarySubPath) { # Open web $web = Get-SPWeb $WebUrl $file = Get-Item $SourceFilePath write-host "Started Uploading File…" $file.FullName # Open file $fileStream = ([System.IO.FileInfo] (Get-Item $file.FullName)).OpenRead() # Open Style Library $folder = $web.getfolder("Style Library") # Check whether the file is already exists? $File2Replace = $web.GetFile($folder.Url + $StyleLibrarySubPath + $file.Name) if($File2Replace.Exists…
-
Relative Paths in SharePoint using SPUrlExpressionBuilder ($SPUrl)
Two useful links: http://thechriskent.com/2012/04/02/relative-paths-in-sharepoint-using-spurlexpressionbuilder-spurl/ http://blog.bugrapostaci.com/tag/spurl/
-
Url/Uri combine
Isn’t all of us wonder whether there is a good utility method available out of the box to combine uri together, I mean something like Path.Combine(). System.IO.Path.Combine() System.IO.Path.Combine() combines two path strings and manages the trailing separator character (backslash (“\”)). Using Path.Combine() you will get an output which mixes backslashes with forward slashes: string…