Since SharePoint 2013 supports several sets of APIs, you could utilize client APIs (CSOM/REST) in PowerShell.
How to set View.JSlink property using PowerShell in SharePoint Online
CSOM version
The following example demonstrates how to specify View.JSlink property via CSOM in PowerShell:
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client")
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client.Runtime")
Function Get-SPOCredentials([string]$UserName,[string]$Password)
{
if([string]::IsNullOrEmpty($Password)) {
$SecurePassword = Read-Host -Prompt "Enter the password" -AsSecureString
}
else {
$SecurePassword = $Password | ConvertTo-SecureString -AsPlainText -Force
}
return New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($UserName, $SecurePassword)
}
Function Configure-ListView([Microsoft.SharePoint.Client.ClientContext]$Context, [string]$ListTitle,[string]$ViewTitle)
{
$list = $Context.Web.Lists.GetByTitle($ListTitle)
$view = $list.Views.GetByTitle($ViewTitle)
$view.JSLink = "~sitecollection/SiteAssets/Tasks.js"
$view.Update()
$Context.ExecuteQuery()
}
Usage
$UserName = "[email protected]"
$Password = Read-Host -Prompt "Enter the password"
$WebUrl = "https://contoso.sharepoint.com"
$Context = New-Object Microsoft.SharePoint.Client.ClientContext($WebUrl)
$Context.Credentials = Get-SPOCredentials -UserName $UserName -Password $Password
Configure-ListView -Context $Context -ListTitle "Tasks" -ViewTitle "All Tasks"
$Context.Dispose()
It is also possible to accomplish using REST API, since this API could be consumed in PowerShell, follow this article for a more details.