In my case, I was using PowerShell to create a bunch of links to folders on a file-share in a SharePoint list. I came across errors when I used the 2010 method in 2013. Below I have provided examples of each method:
$urlValue = New-Object Microsoft.SharePoint.SPFieldUrlValue("")
$urlValue.Description = "This is an awesome description"
$urlValue.Url = "http://MyUrl.com"
$item["URL"] = $urlValue
$newItem = $list.Items.Add()
$newItem["URL"] = "$urlString , $descriptionString"
$newItem["Comments"] = $descriptionString
If you attempt to execute a PowerShell script on the SharePoint server and see : “Script cannot loaded. The file is not digitally signed. The script will not be executed on the system” or “… the execution of the script is disabled on the system…”
It means you either need to :
Sign the script OR
Set the PowerShell execution policy to allow you to execute unsigned scripts, e.g.
powershell.exe -executionpolicy bypass -file C:\script.ps1
If you want to make changes to a PowerShell script but you are always prompted to save as a new version, the file may be locked. Right click the script file and select Properties. Ensure the Read-Only checkbox is unchecked. If there is a Unblock button next to the Read Only property, click Unblock.