Stop, Start, or Restart a SSAS Tabular service instance in PowerShell with Invoke-Command and $variables
The script block works a bit different when it comes to passing variables. You have to tell the command what the variable contains on the remote computer.

As well if you want to pass the full command as a variable you will need at the type of the variable as [scriptblock]. 

$stop = "stop-service 'MSOLAP$TABULAR'" 
Invoke-Command -ComputerName $server { $stop } 


This needs to be changed to something like this (changed variable names to suite my example):

$MyService = 'W32Time'
$get = [scriptblock]::create( "param(`$servicename) Stop-Service `$servicename") 
Invoke-Command -ComputerName sql2014-01 -ScriptBlock $get -ArgumentList $MyService




The other way:

$MyService = 'W32Time'
Invoke-Command -ComputerName SQL2014-01 -ScriptBlock {param($servicename); Stop-Service $servicename }  -ArgumentList $MyService