A comprehensive guide to professional PowerShell scripting using VS Code and Claude Code for CyberArk PAM Self-Hosted and Privilege Cloud environments.
This repository provides A+ grade documentation, guidelines, and best practices for CyberArk PAM consultants who need to write professional, maintainable PowerShell scripts for:
- CyberArk PAM Self-Hosted (on-premises deployments)
- CyberArk Privilege Cloud (SaaS/cloud deployments)
- Automation of PAM administrative tasks
- Integration with enterprise systems
- Custom reporting and compliance automation
- Migration and deployment scripts
- GETTING_STARTED.md - Initial setup and environment configuration
- VSCODE_SETUP.md - VS Code installation, extensions, and configuration
- CLAUDE_CODE_GUIDE.md - Using Claude Code for AI-assisted PowerShell development
- CYBERARK_IMPLEMENTATION.md - Complete PAM implementation guide (Self-Hosted & Privilege Cloud)
- CYBERARK_SCRIPTING.md - CyberArk-specific scripting patterns and practices (13 professional patterns)
- CODING_STANDARDS.md - A+ code quality standards and style guide
- ERROR_HANDLING.md - Professional error handling and logging
- SECURE_CREDENTIALS.md - Secure credential storage (DPAPI, certificates, AAM/CP, Key Vault)
- CONJUR_INTEGRATION.md - CyberArk Conjur secrets management integration
- GIT_GUIDE.md - Git workflows, branching strategies, and security
- CLAUDE_CODE_BEST_PRACTICES.md - Advanced Claude Code techniques for 5-10x productivity
- CLAUDE_CODE_AGENTS_GUIDE.md - Managing Claude Code agents for debugging and workflow optimization
- CLAUDE_CODE_WORKFLOWS.md - 8 end-to-end workflows for feature development, debugging, and code review
- QUICK_REFERENCE.md - Quick reference for common tasks
- TROUBLESHOOTING.md - Common issues and solutions
- GLOSSARY.md - Terminology and definitions
- Windows 10/11 or Windows Server 2019+
- PowerShell 7.4+ (PowerShell Core)
- Visual Studio Code
- Claude Code extension for VS Code
- CyberArk REST API access (PVWA/Privilege Cloud)
# 1. Install PowerShell 7
winget install Microsoft.PowerShell
# 2. Install VS Code
winget install Microsoft.VisualStudioCode
# 3. Install psPAS module (required for CyberArk API operations)
Install-Module -Name psPAS -Scope CurrentUser -Force
# 4. Install PSScriptAnalyzer for code quality checks
Install-Module -Name PSScriptAnalyzer -Scope CurrentUser -Force
# 5. Install required VS Code extensions (see VSCODE_SETUP.md)
# - PowerShell extension
# - Claude Code extension
# 6. Clone this repository
git clone <your-repo-url>
cd scripting
# 7. Review the getting started guide
code docs/GETTING_STARTED.mdscripting/
βββ README.md # This file
βββ docs/ # Documentation (16 comprehensive guides)
β βββ GETTING_STARTED.md # Initial setup and environment configuration
β βββ VSCODE_SETUP.md # VS Code installation, extensions, and configuration
β βββ CLAUDE_CODE_GUIDE.md # AI-assisted PowerShell development (16 prompts)
β βββ CYBERARK_IMPLEMENTATION.md # Complete PAM implementation (Self-Hosted & Cloud)
β βββ CYBERARK_SCRIPTING.md # 13 professional scripting patterns
β βββ CODING_STANDARDS.md # A+ code quality standards
β βββ ERROR_HANDLING.md # Professional error handling patterns
β βββ SECURE_CREDENTIALS.md # Secure credential storage (DPAPI, certificates, AAM)
β βββ CONJUR_INTEGRATION.md # CyberArk Conjur secrets management integration
β βββ GIT_GUIDE.md # Git workflows and security
β βββ CLAUDE_CODE_BEST_PRACTICES.md # Advanced AI development techniques
β βββ CLAUDE_CODE_AGENTS_GUIDE.md # Managing agents for debugging and workflows
β βββ CLAUDE_CODE_WORKFLOWS.md # 8 end-to-end development workflows
β βββ QUICK_REFERENCE.md # Quick reference for daily tasks
β βββ TROUBLESHOOTING.md # Common issues and solutions
β βββ GLOSSARY.md # Terminology and definitions
βββ templates/ # Script templates
β βββ basic-script-template.ps1 # Basic script structure
β βββ cyberark-api-template.ps1 # Advanced CyberArk API template
βββ examples/ # Production-ready examples
β βββ account-management/ # Account operations
β β βββ Bulk-Onboard-Accounts.ps1 # Bulk account onboarding
β β βββ sample-accounts.csv # Sample CSV template
β βββ safe-management/ # Safe operations
β β βββ New-SafeStructure.ps1 # Standardized Safe creation
β βββ reporting/ # Reporting scripts
β β βββ Generate-AccountAuditReport.ps1 # Comprehensive audit reporting
β βββ implementation/ # CyberArk implementation automation
β β βββ Create-SafeStructure.ps1 # Automated Safe structure creation
β β βββ safe-structure-sample.csv # Safe definition template
β β βββ README.md # Implementation examples guide
β βββ ansible/ # Ansible automation with CyberArk
β β βββ README.md # Complete Ansible integration guide
β β βββ ansible.cfg # Ansible configuration
β β βββ inventory/ # Dynamic inventory from CyberArk
β β βββ playbooks/ # 4 production playbooks
β β β βββ server-configuration.yml # Infrastructure management
β β β βββ database-backup.yml # Database automation
β β β βββ cicd-deployment.yml # CI/CD integration
β β β βββ certificate-rotation.yml # Security automation
β β βββ roles/ # Reusable Ansible roles
β β β βββ cyberark_credential_retrieval/ # Credential retrieval role
β β βββ group_vars/ # Environment configuration
β βββ conjur/ # CyberArk Conjur integration
β βββ ConjurHelper.psm1 # Reusable Conjur module
β βββ CyberArk-Automation-WithConjur.ps1 # Complete automation example
β βββ conjur-config-sample.json # Configuration template
β βββ README.md # Conjur examples documentation
βββ .vscode/ # VS Code configuration
βββ cyberark.code-snippets # 20+ CyberArk snippets
βββ settings.json # Workspace settings
- β A+ Documentation - Every concept explained clearly with examples
- β Industry Best Practices - Following Microsoft and CyberArk guidelines
- β Production-Ready - Code templates ready for enterprise use
- β Security-First - Secure coding practices built-in
- β REST API Integration - Complete API usage examples
- β PrivateArk SDK - Legacy integration when needed
- β Privilege Cloud - SaaS-specific considerations
- β Self-Hosted PAM - On-premises patterns
- β VS Code Integration - Optimized workspace configuration
- β Claude Code AI - Leverage AI for faster development
- β PowerShell 7+ - Modern PowerShell features
- β Git Workflows - Version control best practices
- Onboarding privileged accounts in bulk
- Account rotation and reconciliation
- Account discovery and provisioning
- Custom account properties management
- Safe creation and configuration
- Permission management automation
- Safe member provisioning
- Compliance reporting
- Audit log analysis
- Access reviews automation
- Compliance dashboard data
- Custom reporting for HIPAA, PCI-DSS, SOX
- Account migration between environments
- Safe structure replication
- Configuration export/import
- Environment synchronization
- User and group management
- Platform configuration
- Health monitoring scripts
- Backup automation
- Server/infrastructure configuration with CyberArk credentials
- Database backup automation with dynamic credential retrieval
- CI/CD deployment integration (Jenkins, GitLab, GitHub Actions)
- Certificate rotation and security automation
- Dynamic inventory from CyberArk accounts
- PowerShell 7.4+ - Modern PowerShell scripting
- Visual Studio Code - Primary development environment
- Claude Code - AI-assisted development
- Git - Version control
- CyberArk REST API - Primary integration method
- PrivateArk Client SDK - Legacy integration (when required)
- Privilege Cloud APIs - SaaS-specific endpoints
- PACLI - Command-line interface (deprecated but documented)
- psPAS - Official CyberArk REST API PowerShell module (required dependency)
- Pester - PowerShell testing framework
- PSScriptAnalyzer - Code quality analysis
- platyPS - Documentation generation
- Azure DevOps / GitHub Actions - CI/CD integration
- Complete environment setup (GETTING_STARTED.md)
- Learn VS Code basics (VSCODE_SETUP.md)
- Get started with Claude Code (CLAUDE_CODE_GUIDE.md)
- Practice with basic templates (templates/)
- Master CyberArk REST API usage (CYBERARK_SCRIPTING.md - 13 patterns)
- Implement error handling patterns (ERROR_HANDLING.md)
- Apply coding standards (CODING_STANDARDS.md)
- Study real-world examples (examples/)
- Secure credential management (SECURE_CREDENTIALS.md - DPAPI, AAM, Key Vault)
- Git workflows and version control (GIT_GUIDE.md)
- Claude Code advanced techniques (CLAUDE_CODE_BEST_PRACTICES.md)
- Master AI-assisted workflows (CLAUDE_CODE_WORKFLOWS.md - 8 workflows)
- Leverage agents for debugging (CLAUDE_CODE_AGENTS_GUIDE.md)
- Build custom solutions for your environment
This is a living documentation repository. Contributions are welcome:
- Submit Issues - Report errors or request new content
- Improve Documentation - Submit pull requests with improvements
- Share Examples - Add your own script examples (sanitized)
- Best Practices - Share lessons learned from the field
- Never commit credentials to version control
- Sanitize all examples - Remove customer-specific information
- Review before sharing - Ensure no sensitive data in scripts
- Use secret management - Leverage CyberArk for script credentials
- Scripts provided as examples and templates
- Test thoroughly in non-production environments first
- Adapt to your specific environment and requirements
- Follow your organization's change management processes
- CyberArk Marketplace - Official scripts and tools
- CyberArk REST API Documentation
- CyberArk Community - Forums and discussions
- CyberArk Campus - Training resources
This documentation repository is provided for educational and professional development purposes. Scripts and examples are provided as-is without warranty.
β Begin with GETTING_STARTED.md
β Bookmark QUICK_REFERENCE.md for daily use
Last Updated: 2025-11-22 Version: 2.0 Maintained by: CyberArk PAM Consultants Community
- 16 comprehensive guides covering all aspects of CyberArk PowerShell development
- 13,000+ lines of professional documentation
- 20+ VS Code snippets for instant productivity
- 5 production-ready example scripts with full error handling
- 5 secure credential storage methods documented (DPAPI, certificates, AAM/CP, Conjur, Key Vault)
- 8 complete AI-assisted development workflows
- 13 CyberArk scripting patterns for enterprise automation
- Complete implementation guide for Self-Hosted and Privilege Cloud deployments
- Complete Conjur integration with PowerShell module and examples