I am trying to rename a cube using Rename-Item but it doesn't work, with the following error returned:
Here is my code:
Import-Module SqlServer
$Analysis_Server = New-Object Microsoft.AnalysisServices.Server
$Analysis_Server.connect("server1")
$cube_name = $Analysis_Server.Databases.FindByName("Snapshot-4")
$cube_name | Rename-Item -NewName ("Snapshot-xy")
error:
Rename-Item : Illegal characters in path.
Rename-Item : Cannot rename because item at '<DatabaseID>Snapshot-4</DatabaseID>' does not
exist.
The database most certainly exists. I verified the ID matches as well using $cube_name.ID
Is it not possible to rename a cube in powershell?