{"id":28762398,"url":"https://github.com/rubrikinc/rubrik-powershell-sdk","last_synced_at":"2026-04-02T18:36:40.150Z","repository":{"id":173728837,"uuid":"504613066","full_name":"rubrikinc/rubrik-powershell-sdk","owner":"rubrikinc","description":"The Rubrik Security Cloud SDK","archived":false,"fork":false,"pushed_at":"2026-03-29T23:24:21.000Z","size":266935,"stargazers_count":17,"open_issues_count":4,"forks_count":11,"subscribers_count":11,"default_branch":"main","last_synced_at":"2026-03-30T01:34:17.475Z","etag":null,"topics":["powershell","rubrik","rubrik-security-cloud","sdk","sdk-powershell"],"latest_commit_sha":null,"homepage":"https://www.powershellgallery.com/packages/RubrikSecurityCloud","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rubrikinc.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-06-17T17:04:22.000Z","updated_at":"2026-03-29T23:24:08.000Z","dependencies_parsed_at":"2024-03-25T20:31:11.210Z","dependency_job_id":"ed86cf30-fcb0-4e13-b2e0-0b41ad4da8dd","html_url":"https://github.com/rubrikinc/rubrik-powershell-sdk","commit_stats":null,"previous_names":["rubrikinc/rubrik-powershell-sdk"],"tags_count":62,"template":false,"template_full_name":null,"purl":"pkg:github/rubrikinc/rubrik-powershell-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubrikinc%2Frubrik-powershell-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubrikinc%2Frubrik-powershell-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubrikinc%2Frubrik-powershell-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubrikinc%2Frubrik-powershell-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rubrikinc","download_url":"https://codeload.github.com/rubrikinc/rubrik-powershell-sdk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubrikinc%2Frubrik-powershell-sdk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31313013,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T12:59:32.332Z","status":"ssl_error","status_checked_at":"2026-04-02T12:54:48.875Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["powershell","rubrik","rubrik-security-cloud","sdk","sdk-powershell"],"created_at":"2025-06-17T08:08:27.610Z","updated_at":"2026-04-02T18:36:40.118Z","avatar_url":"https://github.com/rubrikinc.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rubrik Security Cloud SDK\n\nThank you for using the Rubrik Security Cloud PowerShell SDK.\n\nWe rely on\n[your feedback](https://github.com/rubrikinc/rubrik-powershell-sdk/discussions)\nto improve the SDK !\n\nRubrik fully supports this SDK. If you have problems with the SDK, please open a GitHub issue or contact your account team. Please note that Rubrik supports the SDK, but can't debug your scripts.\n\nIf you need to work with the CDM SDK, please see:\n[github.com/rubrikinc/rubrik-sdk-for-powershell](https://github.com/rubrikinc/rubrik-sdk-for-powershell)\n\n## :hammer: Installation\n\n### Powershell \u003e= 5.0\n\nThis release needs PowerShell 5.0 or later.\n\n#### Operating Systems that Support PowerShell 5.0\n\n1. Windows Server: PowerShell \u003e=5.0 comes installed by default on\n   Windows Server 2016 and later\n2. Windows Client OS: PowerShell \u003e=5.0 comes installed by default on\n   Windows 10 and later\n3. Linux and Mac: PowerShell \u003e=5.0 is available for Linux and Mac OS X\n   via the [PowerShell Core](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-macos)\n\n### Install from the PowerShell Gallery\n\nThis is the recommended way to install the SDK.\n\n```powershell\nInstall-Module -Name RubrikSecurityCloud\n```\n\nMore info: [RubrikSecurityCloud package on the gallery](https://www.powershellgallery.com/packages/RubrikSecurityCloud)\n\n### Install from source\n\nFor advanced users, you can install the SDK from source.\nIt will allow you to see the SDK source code and\ncontribute to it.\n\nStart by cloning the repo:\n\n```shell\ngit clone git@github.com:rubrikinc/rubrik-powershell-sdk.git\ncd rubrik-powershell-sdk\n```\n\nThen install the module from local sources:\n\n```powershell\n./Utils/Import-RscModuleFromLocalOutputDir.ps1\n```\n\n### Import the SDK module\n\n```powershell\nImport-Module RubrikSecurityCloud\n```\n\n## Getting Started\n\n### :key: Service Account files\n\nRetrieve a [service account file from the RSC UI](https://docs.rubrik.com/en-us/saas/saas/service_account.html),\n\nand store it locally, say: `/path/to/service/account/file.json`.\n\nNote that JSON files retrieved from the RSC UI are\n**clear text** files that contain a **secret**.\n\nFirst, generate an **encrypted** service account file\nfrom the clear-text one and delete the clear-text one:\n\n```powershell\nSet-RscServiceAccountFile /path/to/service/account/file.json\n```\n\n`Set-RscServiceAccountFile` will generate an encrypted service account (SA)\nfile, store it in a default location, and prompt you to delete the\nclear-text SA file. We recommend that you delete the clear-text SA file\nafter you have generated the encrypted one to avoid any security issues\n(if you ever need a clear-text SA file again, they can easily be\nretrieved from the RSC UI).\n\nYou only need to do the step with `Set-RscServiceAccountFile` once.\n\n\u003e :warning: If no user profile is created and -OutputFilePath is not specified,\n\u003e follow these steps:\n\u003e\n\u003e 1. Check whether a profile exists by running `Test-Path $PROFILE` in\n\u003e    PowerShell. If this command returns `True`, then a profile exists.\n\u003e    If it returns `False`, proceed to the next step.\n\u003e\n\u003e 2. You can create a new profile using the `New-Item` command:\n\u003e    `New-Item -ItemType File -Path $PROFILE -Force`.\n\u003e    This creates a new file at the location specified by `$PROFILE`,\n\u003e    which is where PowerShell looks for your profile.\n\n### :electric_plug: Connecting to RSC\n\nAfter that, you can connect to RSC with:\n\n```powershell\nConnect-Rsc\n```\n\nIt will see that there is an encrypted SA file in the default location,\nuse it to retrieve an access token from the API server,\nand store it in the session state.\nAny subsequent calls to `Connect-Rsc` will use the same token.\n\nAs a matter of fact, it is OK to call `Connect-Rsc` willy-nilly;\nfor example, you can start every script you write with `Connect-Rsc` at the\ntop, and it will re-use any connection existing in the session, or\ncreate a new one if needed. Note also that any existing connection in\nthe session is only visible within your session and is not visible\nto other sessions, or to other users.\n\n### :hourglass: SDK version vs API version\n\nNow that you're connected, it's good to make sure your version\nof the SDK is not too far off from the version of the API server.\nRun:\n\n```powershell\nPS\u003e Get-RscVersion\n\nSdkSchemaVersion ServerVersion\n---------------- -------------\nv20230524-16     v20230524-16\n```\n\nIf your SDK version is too old, you will see a warning.\nYou can still use the SDK, but you may not be able to use\nthe latest features of the API server, and you may see\nsome deprecation errors in your scripts. It's important to note\nthat the SDK is backward compatible, but only for a limited\ntime. If when running your scripts, you see deprecation errors,\nyou should upgrade your SDK to the latest version as soon as\npossible before the deprecated features are removed from the API server.\n\n### :running: Running commands\n\nYou can then run any of the commands in the SDK,\nfor example, to retrieve the current account info:\n\n```powershell\nGet-RscAccount\nGet-RscAccount -Detail\n(Get-RscAccount).AccountId\n```\n\nTo list clusters using `New-RscQuery -Gql` (the recommended approach):\n\n```powershell\n# Create and run a query by GraphQL name\n$result = New-RscQuery -Gql clusterConnection | Invoke-Rsc\n$result.Nodes | Select-Object Id, Name, Status\n\n# With variables: get the first 3 clusters\n$result = New-RscQuery -Gql clusterConnection -Var @{ first = 3 } | Invoke-Rsc\n$result.Nodes.Name\n\n# Add fields not in the default set\n$result = New-RscQuery -Gql clusterConnection -AddField Nodes.Version | Invoke-Rsc\n$result.Nodes | Select-Object Name, Version\n```\n\nFor mutations (creating, updating, deleting resources), see\n[How To Run Mutations](docs/HOWTO_mutations.md).\n\nOr use wrapper cmdlets for common operations:\n\n```powershell\n$c=Get-RscCluster\n$c # show all clusters\n$c.Count # show number of clusters\n$c[0] # show first cluster\n$c.id # list cluster ids\n```\n\nTo run raw GraphQL queries:\n\n```powershell\nInvoke-Rsc -Gql \"query accountSettings{accountSettings{isEulaAccepted}}\"\n\n$vms=(Invoke-Rsc -Gql \n  \"query GetVsphereVmList{vSphereVmNewConnection{nodes{id name}}}\").Nodes\n```\n\nTo see all cmdlets in the SDK:\n\n```powershell\n(Get-Module RubrikSecurityCloud).ExportedCommands.Keys | Sort-Object\n```\n\n### :electric_plug: Disconnecting\n\nThen to disconnect:\n\n```powershell\nDisconnect-Rsc\n```\n\nIt is good practice and recommended to finish your scripts\nwith `Disconnect-Rsc`. Note however that it is not strictly\nnecessary, as the connection will be closed automatically\nwhen the session ends.\n\n## Learning more about this SDK\n\n:point_right: Start with the\n[RSC PowerShell SDK Developer Manual](docs/developer_manual.md).\nOnce you've covered the basics on this page, the developer manual\nwill teach you how to use the SDK to build your own scripts.\n\nIt refers to _samples_ that demonstrate how to use the SDK;\nyou can also peruse the [samples](Samples/) directly.\n\nAnother great way to learn about the SDK is to look at its\nend-to-end (e2e) tests: [tests/e2e](Tests/e2e/)\n\nGraphQL schema reference:\n\n- [Online schema reference](https://rubrikinc.github.io/rubrik-api-documentation/schema/reference)\n- [Local schema reference](docs/graphql/rsc_schema.graphql.json)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubrikinc%2Frubrik-powershell-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frubrikinc%2Frubrik-powershell-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubrikinc%2Frubrik-powershell-sdk/lists"}