├── docs ├── CNAME ├── assets │ ├── icons │ │ ├── icons-192.png │ │ └── icons-512.png │ └── screenshots │ │ ├── customer_id.png │ │ ├── oauth_allow_access.png │ │ ├── oauth_select_account.png │ │ ├── powershell_oauth_link.png │ │ ├── oauth_authorization_code.png │ │ ├── powershell_oauth_success.png │ │ ├── google_cloud_project_creation.png │ │ ├── google_cloud_project_selection.png │ │ ├── service_account_email_address.png │ │ ├── google_cloud_project_credentials.png │ │ ├── google_cloud_project_oauth_client_id.png │ │ ├── google_cloud_project_oauth_playground.png │ │ ├── google_cloud_project_creation_new_project.png │ │ ├── google_cloud_project_oauth_consent_screen.png │ │ ├── google_cloud_project_service_account_done.png │ │ ├── google_cloud_project_service_account_edit.png │ │ ├── google_cloud_project_service_account_role.png │ │ ├── google_cloud_project_oauth_client_id_download.png │ │ ├── google_cloud_project_oauth_playground_scopes.png │ │ ├── google_cloud_project_service_account_add_key.png │ │ ├── google_cloud_project_service_account_details.png │ │ ├── google_cloud_project_service_account_create_key.png │ │ ├── google_cloud_project_oauth_consent_screen_app_name.png │ │ ├── google_cloud_project_oauth_consent_screen_finish.png │ │ ├── google_cloud_project_oauth_consent_screen_overview.png │ │ ├── google_cloud_project_service_account_key_download.png │ │ ├── google_cloud_project_oauth_playground_sign_in_to_app.png │ │ ├── google_cloud_project_oauth_playground_external_testing.png │ │ ├── google_cloud_project_service_account_advanced_settings.png │ │ ├── google_cloud_project_oauth_playground_authorization_code.png │ │ ├── google_cloud_project_service_account_domain_wide_delegation.png │ │ ├── google_cloud_project_service_account_domain_wide_delegation_add.png │ │ ├── google_cloud_project_creation_enable_access_to_apis_confirm_project.png │ │ ├── google_cloud_project_creation_enable_access_to_apis_enable_apis_standard.png │ │ └── google_cloud_project_creation_enable_access_to_apis_enable_apis_superadmin.png ├── pages │ ├── installation │ │ ├── overview.md │ │ ├── powershell_gallery.md │ │ ├── github_releases.md │ │ └── building_from_source.md │ ├── function_help │ │ ├── Helpers │ │ │ ├── Block-CoreCLREncryptionWarning.md │ │ │ ├── Unblock-CoreCLREncryptionWarning.md │ │ │ └── Compare-ModuleVersion.md │ │ ├── Configuration │ │ │ ├── Show-PSGSuiteConfig.md │ │ │ ├── Switch-PSGSuiteConfig.md │ │ │ └── Export-PSGSuiteConfig.md │ │ ├── Drive │ │ │ ├── Stop-GSDriveFileUpload.md │ │ │ ├── Hide-GSDrive.md │ │ │ ├── Get-GSDriveFileUploadStatus.md │ │ │ ├── Get-GSDriveProfile.md │ │ │ ├── Show-GSDrive.md │ │ │ └── Get-GSDriveFolderSize.md │ │ ├── Authentication │ │ │ ├── Clear-PSGSuiteServiceCache.md │ │ │ ├── Get-PSGSuiteServiceCache.md │ │ │ └── Get-GSToken.md │ │ ├── Customers │ │ │ └── Get-GSCustomer.md │ │ ├── Domains │ │ │ ├── New-GSDomain.md │ │ │ ├── Get-GSDomain.md │ │ │ ├── New-GSDomainAlias.md │ │ │ ├── Get-GSDomainAlias.md │ │ │ ├── Remove-GSDomain.md │ │ │ └── Remove-GSDomainAlias.md │ │ ├── Gmail │ │ │ ├── Get-GSGmailPopSettings.md │ │ │ ├── Get-GSGmailProfile.md │ │ │ ├── Get-GSGmailImapSettings.md │ │ │ ├── Get-GSGmailVacationSettings.md │ │ │ ├── Get-GSGmailAutoForwardingSettings.md │ │ │ ├── Get-GSGmailLanguageSettings.md │ │ │ ├── Restore-GSGmailMessage.md │ │ │ ├── Get-GSGmailLabel.md │ │ │ ├── Get-GSGmailSendAsAlias.md │ │ │ ├── Get-GSGmailForwardingAddress.md │ │ │ ├── Send-GSGmailSendAsConfirmation.md │ │ │ ├── Add-GSGmailForwardingAddress.md │ │ │ └── Get-GSGmailFilter.md │ │ ├── Schemas │ │ │ ├── Get-GSUserSchema.md │ │ │ ├── Remove-GSUserSchema.md │ │ │ └── New-GSUserSchema.md │ │ ├── Chat │ │ │ ├── Get-GSChatMessage.md │ │ │ ├── Get-GSChatSpace.md │ │ │ ├── Get-GSChatMember.md │ │ │ └── Remove-GSChatMessage.md │ │ ├── Groups │ │ │ ├── Get-GSGroupSettings.md │ │ │ ├── Get-GSGroupAlias.md │ │ │ ├── New-GSGroupAlias.md │ │ │ ├── Test-GSGroupMembership.md │ │ │ ├── Remove-GSGroup.md │ │ │ └── New-GSGroup.md │ │ ├── Security │ │ │ ├── Revoke-GSUserVerificationCodes.md │ │ │ ├── New-GSUserVerificationCodes.md │ │ │ ├── Get-GSUserVerificationCodes.md │ │ │ ├── Get-GSUserASP.md │ │ │ ├── Get-GSUserToken.md │ │ │ └── Remove-GSMobileDevice.md │ │ ├── Contacts │ │ │ └── Get-GSContactList.md │ │ ├── Users │ │ │ ├── Get-GSUserAlias.md │ │ │ ├── New-GSUserAlias.md │ │ │ ├── Update-GSUserPhoto.md │ │ │ └── Remove-GSUser.md │ │ ├── Classroom │ │ │ ├── Get-GSCourseAlias.md │ │ │ ├── Get-GSClassroomUserProfile.md │ │ │ └── Confirm-GSCourseInvitation.md │ │ ├── Licensing │ │ │ ├── Set-GSUserLicense.md │ │ │ └── Update-GSUserLicense.md │ │ ├── URL Shortener │ │ │ └── New-GSShortUrl.md │ │ ├── Tasks │ │ │ ├── New-GSTasklist.md │ │ │ └── Update-GSTasklist.md │ │ ├── Org Units │ │ │ └── Remove-GSOrganizationalUnit.md │ │ ├── Roles │ │ │ ├── Remove-GSAdminRole.md │ │ │ └── New-GSAdminRole.md │ │ └── Sheets │ │ │ └── New-GSSheet.md │ └── examples │ │ └── multi_use_configuration.md ├── manifest.webmanifest └── .nav.yml ├── Tests ├── 2. Unit Tests │ └── Configuration │ │ ├── AppEmailOnly.psd1 │ │ ├── ClientSecrets.psd1 │ │ ├── JSONServiceOnly.psd1 │ │ ├── JSONServiceAndAdminEmail.psd1 │ │ ├── JSONServiceKey.json │ │ └── JSONConfiguration.json └── 0. Mocks │ └── Core.Mocks.ps1 ├── bin └── img │ └── psgsuite2.0.0.png ├── CODEOWNERS ├── requirements.txt ├── .gitignore ├── PSGSuite ├── PSGSuite.psm1 ├── Private │ ├── Get-SafeFileName.ps1 │ ├── ThrowTerm.ps1 │ ├── Convert-DateToEpoch.ps1 │ ├── Get-PSGSuiteConfigNames.ps1 │ ├── Out-TruncatedString.ps1 │ ├── Test-FileLock.ps1 │ ├── Convert-EpochToDate.ps1 │ ├── ListPrivate │ │ ├── Get-GSUserSchemaListPrivate.ps1 │ │ ├── Get-GSUserASPListPrivate.ps1 │ │ ├── Get-GSUserTokenListPrivate.ps1 │ │ ├── Get-GSOrganizationalUnitListPrivate.ps1 │ │ └── Get-GSShortUrlListPrivate.ps1 │ ├── Resolve-Email.ps1 │ ├── Read-MimeMessage.ps1 │ ├── Read-Prompt.ps1 │ ├── Get-MimeType.ps1 │ └── Convert-Base64.ps1 └── Public │ ├── Configuration │ └── Show-PSGSuiteConfig.ps1 │ ├── Helpers │ ├── Block-CoreCLREncryptionWarning.ps1 │ └── Unblock-CoreCLREncryptionWarning.ps1 │ ├── Authentication │ ├── Clear-PSGSuiteServiceCache.ps1 │ ├── Get-PSGSuiteServiceCache.ps1 │ └── Get-GSToken.ps1 │ ├── Customers │ └── Get-GSCustomer.ps1 │ ├── Drive │ ├── Stop-GSDriveFileUpload.ps1 │ └── Get-GSDocContent.ps1 │ ├── Chat │ ├── Get-GSChatMessage.ps1 │ └── Remove-GSChatMessage.ps1 │ ├── Domains │ ├── New-GSDomain.ps1 │ ├── Remove-GSDomain.ps1 │ └── Remove-GSDomainAlias.ps1 │ ├── Org Units │ └── Remove-GSOrganizationalUnit.ps1 │ ├── Groups │ ├── Remove-GSGroup.ps1 │ └── Get-GSGroupAlias.ps1 │ ├── Gmail │ ├── Get-GSGmailPopSettings.ps1 │ ├── Get-GSGmailImapSettings.ps1 │ ├── Get-GSGmailVacationSettings.ps1 │ ├── Get-GSGmailAutoForwardingSettings.ps1 │ ├── Get-GSGmailProfile.ps1 │ └── Get-GSGmailLanguageSettings.ps1 │ ├── Classroom │ ├── Get-GSCourseAlias.ps1 │ └── Remove-GSCourse.ps1 │ ├── Schemas │ └── Get-GSUserSchema.ps1 │ ├── Users │ └── Remove-GSUser.ps1 │ ├── Security │ ├── Remove-GSMobileDevice.ps1 │ └── Revoke-GSUserVerificationCodes.ps1 │ └── Roles │ └── Remove-GSAdminRole.ps1 ├── .github └── ISSUE_TEMPLATE │ ├── feature_request.md │ └── bug_report.md └── ci └── UpdateNuGetDependenciesJson.ps1 /docs/CNAME: -------------------------------------------------------------------------------- 1 | psgsuite.io -------------------------------------------------------------------------------- /Tests/2. Unit Tests/Configuration/AppEmailOnly.psd1: -------------------------------------------------------------------------------- 1 | @{ 2 | AppEmail = 'app@psgsuite.io' 3 | } 4 | -------------------------------------------------------------------------------- /bin/img/psgsuite2.0.0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SCRT-HQ/PSGSuite/HEAD/bin/img/psgsuite2.0.0.png -------------------------------------------------------------------------------- /docs/assets/icons/icons-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SCRT-HQ/PSGSuite/HEAD/docs/assets/icons/icons-192.png -------------------------------------------------------------------------------- /docs/assets/icons/icons-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SCRT-HQ/PSGSuite/HEAD/docs/assets/icons/icons-512.png -------------------------------------------------------------------------------- /docs/assets/screenshots/customer_id.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SCRT-HQ/PSGSuite/HEAD/docs/assets/screenshots/customer_id.png -------------------------------------------------------------------------------- /docs/assets/screenshots/oauth_allow_access.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SCRT-HQ/PSGSuite/HEAD/docs/assets/screenshots/oauth_allow_access.png -------------------------------------------------------------------------------- /docs/assets/screenshots/oauth_select_account.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SCRT-HQ/PSGSuite/HEAD/docs/assets/screenshots/oauth_select_account.png -------------------------------------------------------------------------------- /docs/assets/screenshots/powershell_oauth_link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SCRT-HQ/PSGSuite/HEAD/docs/assets/screenshots/powershell_oauth_link.png -------------------------------------------------------------------------------- /docs/assets/screenshots/oauth_authorization_code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SCRT-HQ/PSGSuite/HEAD/docs/assets/screenshots/oauth_authorization_code.png -------------------------------------------------------------------------------- /docs/assets/screenshots/powershell_oauth_success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SCRT-HQ/PSGSuite/HEAD/docs/assets/screenshots/powershell_oauth_success.png -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | # General approvers/owners 2 | * @scrthq @jgeron-suhsd 3 | 4 | # Pipeline / CI/CD files 5 | azure-pipelines.yml @scrthq 6 | .github/workflows/** @scrthq 7 | -------------------------------------------------------------------------------- /docs/assets/screenshots/google_cloud_project_creation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SCRT-HQ/PSGSuite/HEAD/docs/assets/screenshots/google_cloud_project_creation.png -------------------------------------------------------------------------------- /docs/assets/screenshots/google_cloud_project_selection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SCRT-HQ/PSGSuite/HEAD/docs/assets/screenshots/google_cloud_project_selection.png -------------------------------------------------------------------------------- /docs/assets/screenshots/service_account_email_address.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SCRT-HQ/PSGSuite/HEAD/docs/assets/screenshots/service_account_email_address.png -------------------------------------------------------------------------------- /docs/assets/screenshots/google_cloud_project_credentials.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SCRT-HQ/PSGSuite/HEAD/docs/assets/screenshots/google_cloud_project_credentials.png -------------------------------------------------------------------------------- /docs/assets/screenshots/google_cloud_project_oauth_client_id.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SCRT-HQ/PSGSuite/HEAD/docs/assets/screenshots/google_cloud_project_oauth_client_id.png -------------------------------------------------------------------------------- /docs/assets/screenshots/google_cloud_project_oauth_playground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SCRT-HQ/PSGSuite/HEAD/docs/assets/screenshots/google_cloud_project_oauth_playground.png -------------------------------------------------------------------------------- /docs/assets/screenshots/google_cloud_project_creation_new_project.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SCRT-HQ/PSGSuite/HEAD/docs/assets/screenshots/google_cloud_project_creation_new_project.png -------------------------------------------------------------------------------- /docs/assets/screenshots/google_cloud_project_oauth_consent_screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SCRT-HQ/PSGSuite/HEAD/docs/assets/screenshots/google_cloud_project_oauth_consent_screen.png -------------------------------------------------------------------------------- /docs/assets/screenshots/google_cloud_project_service_account_done.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SCRT-HQ/PSGSuite/HEAD/docs/assets/screenshots/google_cloud_project_service_account_done.png -------------------------------------------------------------------------------- /docs/assets/screenshots/google_cloud_project_service_account_edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SCRT-HQ/PSGSuite/HEAD/docs/assets/screenshots/google_cloud_project_service_account_edit.png -------------------------------------------------------------------------------- /docs/assets/screenshots/google_cloud_project_service_account_role.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SCRT-HQ/PSGSuite/HEAD/docs/assets/screenshots/google_cloud_project_service_account_role.png -------------------------------------------------------------------------------- /docs/assets/screenshots/google_cloud_project_oauth_client_id_download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SCRT-HQ/PSGSuite/HEAD/docs/assets/screenshots/google_cloud_project_oauth_client_id_download.png -------------------------------------------------------------------------------- /docs/assets/screenshots/google_cloud_project_oauth_playground_scopes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SCRT-HQ/PSGSuite/HEAD/docs/assets/screenshots/google_cloud_project_oauth_playground_scopes.png -------------------------------------------------------------------------------- /docs/assets/screenshots/google_cloud_project_service_account_add_key.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SCRT-HQ/PSGSuite/HEAD/docs/assets/screenshots/google_cloud_project_service_account_add_key.png -------------------------------------------------------------------------------- /docs/assets/screenshots/google_cloud_project_service_account_details.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SCRT-HQ/PSGSuite/HEAD/docs/assets/screenshots/google_cloud_project_service_account_details.png -------------------------------------------------------------------------------- /docs/assets/screenshots/google_cloud_project_service_account_create_key.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SCRT-HQ/PSGSuite/HEAD/docs/assets/screenshots/google_cloud_project_service_account_create_key.png -------------------------------------------------------------------------------- /docs/assets/screenshots/google_cloud_project_oauth_consent_screen_app_name.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SCRT-HQ/PSGSuite/HEAD/docs/assets/screenshots/google_cloud_project_oauth_consent_screen_app_name.png -------------------------------------------------------------------------------- /docs/assets/screenshots/google_cloud_project_oauth_consent_screen_finish.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SCRT-HQ/PSGSuite/HEAD/docs/assets/screenshots/google_cloud_project_oauth_consent_screen_finish.png -------------------------------------------------------------------------------- /docs/assets/screenshots/google_cloud_project_oauth_consent_screen_overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SCRT-HQ/PSGSuite/HEAD/docs/assets/screenshots/google_cloud_project_oauth_consent_screen_overview.png -------------------------------------------------------------------------------- /docs/assets/screenshots/google_cloud_project_service_account_key_download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SCRT-HQ/PSGSuite/HEAD/docs/assets/screenshots/google_cloud_project_service_account_key_download.png -------------------------------------------------------------------------------- /docs/assets/screenshots/google_cloud_project_oauth_playground_sign_in_to_app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SCRT-HQ/PSGSuite/HEAD/docs/assets/screenshots/google_cloud_project_oauth_playground_sign_in_to_app.png -------------------------------------------------------------------------------- /docs/assets/screenshots/google_cloud_project_oauth_playground_external_testing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SCRT-HQ/PSGSuite/HEAD/docs/assets/screenshots/google_cloud_project_oauth_playground_external_testing.png -------------------------------------------------------------------------------- /docs/assets/screenshots/google_cloud_project_service_account_advanced_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SCRT-HQ/PSGSuite/HEAD/docs/assets/screenshots/google_cloud_project_service_account_advanced_settings.png -------------------------------------------------------------------------------- /docs/assets/screenshots/google_cloud_project_oauth_playground_authorization_code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SCRT-HQ/PSGSuite/HEAD/docs/assets/screenshots/google_cloud_project_oauth_playground_authorization_code.png -------------------------------------------------------------------------------- /docs/assets/screenshots/google_cloud_project_service_account_domain_wide_delegation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SCRT-HQ/PSGSuite/HEAD/docs/assets/screenshots/google_cloud_project_service_account_domain_wide_delegation.png -------------------------------------------------------------------------------- /docs/assets/screenshots/google_cloud_project_service_account_domain_wide_delegation_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SCRT-HQ/PSGSuite/HEAD/docs/assets/screenshots/google_cloud_project_service_account_domain_wide_delegation_add.png -------------------------------------------------------------------------------- /docs/assets/screenshots/google_cloud_project_creation_enable_access_to_apis_confirm_project.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SCRT-HQ/PSGSuite/HEAD/docs/assets/screenshots/google_cloud_project_creation_enable_access_to_apis_confirm_project.png -------------------------------------------------------------------------------- /docs/assets/screenshots/google_cloud_project_creation_enable_access_to_apis_enable_apis_standard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SCRT-HQ/PSGSuite/HEAD/docs/assets/screenshots/google_cloud_project_creation_enable_access_to_apis_enable_apis_standard.png -------------------------------------------------------------------------------- /docs/assets/screenshots/google_cloud_project_creation_enable_access_to_apis_enable_apis_superadmin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SCRT-HQ/PSGSuite/HEAD/docs/assets/screenshots/google_cloud_project_creation_enable_access_to_apis_enable_apis_superadmin.png -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | cairocffi==1.7.1 2 | CairoSVG==2.7.1 3 | Jinja2==3.1.6 4 | mkdocs-awesome-nav==3.1.1 5 | mkdocs-glightbox==0.4.0 6 | mkdocs-material-extensions==1.3.1 7 | mkdocs-material==9.6.11 8 | mkdocs-open-in-new-tab==1.0.8 9 | mkdocs==1.6.1 10 | Pygments==2.19.1 11 | pymdown-extensions==10.14.3 12 | PyYAML==6.0.2 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | **TestPad.ps1 2 | *_Test.ps1 3 | **-PSGSuite.xml 4 | **.insyncdl 5 | .vscode 6 | API-to-Function-Map.md 7 | QueueExample.ps1 8 | ChatBotLoop.ps1 9 | DLLUnpack.ps1 10 | DLLUnpackStg 11 | DLLUnpackStg/* 12 | FunctionBackups 13 | FunctionBackups/* 14 | BuildOutput/* 15 | *config.csv 16 | PSGSuite.zip 17 | PSGSuite*.json 18 | *.psgs 19 | site 20 | docstage 21 | -------------------------------------------------------------------------------- /PSGSuite/PSGSuite.psm1: -------------------------------------------------------------------------------- 1 | Param 2 | ( 3 | [parameter(Position = 0,ValueFromRemainingArguments = $true)] 4 | [AllowNull()] 5 | [Byte[]] 6 | $EncryptionKey = $null, 7 | [parameter(Position = 1)] 8 | [AllowNull()] 9 | [String] 10 | $ConfigName 11 | ) 12 | $ModuleRoot = $PSScriptRoot 13 | New-Variable -Name PSGSuiteKey -Value $EncryptionKey -Scope Global -Force 14 | -------------------------------------------------------------------------------- /PSGSuite/Private/Get-SafeFileName.ps1: -------------------------------------------------------------------------------- 1 | function Get-SafeFileName { 2 | [CmdletBinding()] 3 | Param ( 4 | [parameter(Mandatory,ValueFromPipeline,Position = 0)] 5 | [String] 6 | $Name 7 | ) 8 | Process { 9 | $Name -replace "[$([RegEx]::Escape("$(([System.IO.Path]::GetInvalidFileNameChars() + [System.IO.Path]::GetInvalidPathChars()) -join '')"))]","_" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /PSGSuite/Public/Configuration/Show-PSGSuiteConfig.ps1: -------------------------------------------------------------------------------- 1 | function Show-PSGSuiteConfig { 2 | <# 3 | .SYNOPSIS 4 | Returns the currently loaded config 5 | 6 | .DESCRIPTION 7 | Returns the currently loaded config 8 | 9 | .EXAMPLE 10 | Show-PSGSuiteConfig 11 | #> 12 | [CmdletBinding()] 13 | Param() 14 | Write-Verbose "Showing current PSGSuite config" 15 | $script:PSGSuite 16 | } -------------------------------------------------------------------------------- /PSGSuite/Private/ThrowTerm.ps1: -------------------------------------------------------------------------------- 1 | function ThrowTerm { 2 | Param 3 | ( 4 | [parameter(Mandatory = $true,Position = 0)] 5 | [String] 6 | $Message 7 | ) 8 | New-Object System.Management.Automation.ErrorRecord( 9 | (New-Object Exception $Message), 10 | 'PowerShell.Module.Error', 11 | [System.Management.Automation.ErrorCategory]::OperationStopped, 12 | $null 13 | ) 14 | } -------------------------------------------------------------------------------- /Tests/2. Unit Tests/Configuration/ClientSecrets.psd1: -------------------------------------------------------------------------------- 1 | @{ 2 | ClientSecrets = '{"installed":{"client_id":"123-abc.apps.googleusercontent.com","project_id":"test-data-456","auth_uri":"https://accounts.google.com/o/oauth2/auth","token_uri":"https://oauth2.googleapis.com/token","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","client_secret":"secret","redirect_uris":["urn:ietf:wg:oauth:2.0:oob","http://localhost"]}}' 3 | } 4 | -------------------------------------------------------------------------------- /docs/pages/installation/overview.md: -------------------------------------------------------------------------------- 1 | # Overview 2 | 3 | In order to use this module, you will need the following: 4 | 5 | * Version 2.36.4 and earlier: 6 | * Windows PowerShell 4.0+ 7 | * PowerShell 6.0+ 8 | * Version 3.0.0 and newer: 9 | * PowerShell 7.4+ 10 | * Full Module Functionality: 11 | * Google Workspace SuperAdmin account 12 | * Partial Module Functionality: 13 | * Google Workspace Standard account 14 | * Personal Google account 15 | -------------------------------------------------------------------------------- /PSGSuite/Private/Convert-DateToEpoch.ps1: -------------------------------------------------------------------------------- 1 | function Convert-DateToEpoch { 2 | Param 3 | ( 4 | [parameter(Mandatory = $true,Position = 0,ValueFromPipeline = $true)] 5 | [datetime] 6 | $Date 7 | ) 8 | Begin { 9 | $UnixEpoch = [timezone]::CurrentTimeZone.ToLocalTime([datetime]'1/1/1970') 10 | } 11 | Process { 12 | $result = (("$(($Date - $UnixEpoch).TotalMilliseconds)" -split "\.") -split "\,")[0] 13 | } 14 | End { 15 | return $result 16 | } 17 | } -------------------------------------------------------------------------------- /docs/manifest.webmanifest: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "PSGSuite", 3 | "name": "PSGSuite Docs", 4 | "icons": [ 5 | { 6 | "src": "/assets/icons/icons-192.png", 7 | "type": "image/png", 8 | "sizes": "192x192" 9 | }, 10 | { 11 | "src": "/assets/icons/icons-512.png", 12 | "type": "image/png", 13 | "sizes": "512x512" 14 | } 15 | ], 16 | "start_url": "/", 17 | "background_color": "#2196F3", 18 | "display": "minimal-ui", 19 | "scope": "/", 20 | "theme_color": "#2196F3" 21 | } -------------------------------------------------------------------------------- /PSGSuite/Private/Get-PSGSuiteConfigNames.ps1: -------------------------------------------------------------------------------- 1 | function Get-PSGSuiteConfigNames { 2 | <# 3 | .SYNOPSIS 4 | Gets the current config names for tab completion on Switch-PSGSuiteConfig. 5 | 6 | .DESCRIPTION 7 | Gets the current config names for tab completion on Switch-PSGSuiteConfig. 8 | #> 9 | [cmdletbinding()] 10 | Param () 11 | $fullConf = Import-SpecificConfiguration -CompanyName 'SCRT HQ' -Name 'PSGSuite' -Scope $Script:ConfigScope 12 | $fullConf.Keys | Where-Object {$_ -ne 'DefaultConfig'} 13 | } 14 | -------------------------------------------------------------------------------- /Tests/2. Unit Tests/Configuration/JSONServiceOnly.psd1: -------------------------------------------------------------------------------- 1 | @{ 2 | JSONServiceAccountKey ='{"type":"service_account","project_id":"psgsuite-id","private_key_id":"12345","private_key":"-----BEGIN PRIVATE KEY-----\n-----END PRIVATE KEY-----\n","client_email":"service@psgsuite.io","client_id":"6789","auth_uri":"https://accounts.google.com/o/oauth2/auth","token_uri":"https://oauth2.googleapis.com/token","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","client_x509_cert_url":"https://www.googleapis.com/robot/v1/metadata/x509/service%40psgsuite.io"}' 3 | } 4 | -------------------------------------------------------------------------------- /Tests/2. Unit Tests/Configuration/JSONServiceAndAdminEmail.psd1: -------------------------------------------------------------------------------- 1 | @{ 2 | JSONServiceAccountKey ='{"type":"service_account","project_id":"psgsuite-id","private_key_id":"12345","private_key":"-----BEGIN PRIVATE KEY-----\n-----END PRIVATE KEY-----\n","client_email":"service@psgsuite.io","client_id":"6789","auth_uri":"https://accounts.google.com/o/oauth2/auth","token_uri":"https://oauth2.googleapis.com/token","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","client_x509_cert_url":"https://www.googleapis.com/robot/v1/metadata/x509/service%40psgsuite.io"}' 3 | AdminEmail = 'admin@psgsuite.io' 4 | } 5 | -------------------------------------------------------------------------------- /PSGSuite/Private/Out-TruncatedString.ps1: -------------------------------------------------------------------------------- 1 | function Out-TruncatedString { 2 | [CmdletBinding()] 3 | param ( 4 | [Parameter(Position = 0, ValueFromPipeline = $true)] 5 | [ValidateNotNullOrEmpty()] 6 | [string] $String, 7 | 8 | [Parameter(Position = 1)] 9 | [ValidateRange(0,[int32]::MaxValue)] 10 | [int] $Length = 0 11 | ) 12 | 13 | $outString = $String 14 | 15 | if ($Length -gt 0) { 16 | if ($String.Length -gt $Length) { 17 | $outString = $String.Substring(0,($Length - 3)) + '...' 18 | } 19 | } 20 | 21 | Write-Output $outString 22 | } -------------------------------------------------------------------------------- /Tests/2. Unit Tests/Configuration/JSONServiceKey.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "service_account", 3 | "project_id": "psgsuite-id", 4 | "private_key_id": "12345", 5 | "private_key": "-----BEGIN PRIVATE KEY-----\n-----END PRIVATE KEY-----\n", 6 | "client_email": "service@psgsuite.io", 7 | "client_id": "6789", 8 | "auth_uri": "https://accounts.google.com/o/oauth2/auth", 9 | "token_uri": "https://oauth2.googleapis.com/token", 10 | "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", 11 | "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/service%40psgsuite.io" 12 | } 13 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | 5 | --- 6 | 7 | **Is your feature request related to a problem? Please describe.** 8 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 9 | 10 | **Describe the solution you'd like** 11 | A clear and concise description of what you want to happen. 12 | 13 | **Describe alternatives you've considered** 14 | A clear and concise description of any alternative solutions or features you've considered. 15 | 16 | **Additional context** 17 | Add any other context or screenshots about the feature request here. 18 | -------------------------------------------------------------------------------- /Tests/2. Unit Tests/Configuration/JSONConfiguration.json: -------------------------------------------------------------------------------- 1 | {"JSONServiceAccountKey":"{\r\n \"type\": \"service_account\",\r\n \"project_id\": \"psgsuite-id\",\r\n \"private_key_id\": \"12345\",\r\n \"private_key\": \"-----BEGIN PRIVATE KEY-----\\n-----END PRIVATE KEY-----\\n\",\r\n \"client_email\": \"service@psgsuite.io\",\r\n \"client_id\": \"6789\",\r\n \"auth_uri\": \"https://accounts.google.com/o/oauth2/auth\",\r\n \"token_uri\": \"https://oauth2.googleapis.com/token\",\r\n \"auth_provider_x509_cert_url\": \"https://www.googleapis.com/oauth2/v1/certs\",\r\n \"client_x509_cert_url\": \"https://www.googleapis.com/robot/v1/metadata/x509/service%40psgsuite.io\"\r\n}\r\n"} 2 | -------------------------------------------------------------------------------- /PSGSuite/Private/Test-FileLock.ps1: -------------------------------------------------------------------------------- 1 | function Test-FileLock { 2 | param ( 3 | [parameter(Mandatory = $false)] 4 | [string] 5 | $Path 6 | ) 7 | if ($Path) { 8 | $oFile = New-Object System.IO.FileInfo $Path 9 | if ((Test-Path -Path $Path) -eq $false) { 10 | return $false 11 | } 12 | try { 13 | $oStream = $oFile.Open([System.IO.FileMode]::Open, [System.IO.FileAccess]::ReadWrite, [System.IO.FileShare]::None) 14 | if ($oStream) { 15 | $oStream.Close() 16 | } 17 | return $false 18 | } 19 | catch { 20 | return $true 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /PSGSuite/Public/Helpers/Block-CoreCLREncryptionWarning.ps1: -------------------------------------------------------------------------------- 1 | function Block-CoreCLREncryptionWarning { 2 | <# 3 | .SYNOPSIS 4 | Blocks CoreCLR encryption warning from reappearing (specific to PSGSuite) 5 | 6 | .DESCRIPTION 7 | Blocks CoreCLR encryption warning from reappearing (specific to PSGSuite) by creating a blank txt file in the path: ~\.scrthq 8 | 9 | .EXAMPLE 10 | Block-CoreCLREncryptionWarning 11 | 12 | Creates the breadcrumb file to let PSGSuite know that you've acknowledged the CoreCLR encryption warning and it does not need to be displayed every time the module is imported 13 | #> 14 | New-Item -Path (Join-Path (Join-Path "~" ".scrthq") "BlockCoreCLREncryptionWarning.txt") -ItemType File -Force | Out-Null 15 | } -------------------------------------------------------------------------------- /PSGSuite/Private/Convert-EpochToDate.ps1: -------------------------------------------------------------------------------- 1 | function Convert-EpochToDate { 2 | Param 3 | ( 4 | [parameter(Mandatory = $true,Position = 0,ValueFromPipeline = $true)] 5 | [string] 6 | $EpochString 7 | ) 8 | Begin { 9 | $UnixEpoch = [timezone]::CurrentTimeZone.ToLocalTime([datetime]'1/1/1970') 10 | } 11 | Process { 12 | try { 13 | $result = $UnixEpoch.AddSeconds($EpochString) 14 | } 15 | catch { 16 | try { 17 | $result = $UnixEpoch.AddMilliseconds($EpochString) 18 | } 19 | catch { 20 | $result = $UnixEpoch.AddTicks($EpochString) 21 | } 22 | } 23 | } 24 | End { 25 | return $result 26 | } 27 | } -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | 5 | --- 6 | 7 | **Describe the bug** 8 | A clear and concise description of what the bug is. 9 | 10 | **To Reproduce** 11 | Steps to reproduce the behavior: 12 | 1. 13 | 2. 14 | 3. 15 | 4. 16 | 17 | **Expected behavior** 18 | A clear and concise description of what you expected to happen. 19 | 20 | **Screenshots** 21 | If applicable, add screenshots to help explain your problem. 22 | 23 | **Environment (please complete the following information):** 24 | - OS: [e.g. Windows 10 1803] 25 | - PowerShell Version: [e.g. Core 6.0.2, Windows PowerShell 5.1] 26 | - PSGSuite Version: [e.g. 2.7.2] 27 | 28 | **Additional context** 29 | Add any other context about the problem here. 30 | -------------------------------------------------------------------------------- /docs/pages/function_help/Helpers/Block-CoreCLREncryptionWarning.md: -------------------------------------------------------------------------------- 1 | # Block-CoreCLREncryptionWarning 2 | 3 | ## SYNOPSIS 4 | Blocks CoreCLR encryption warning from reappearing (specific to PSGSuite) 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | Block-CoreCLREncryptionWarning 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Blocks CoreCLR encryption warning from reappearing (specific to PSGSuite) by creating a blank txt file in the path: ~\.scrthq 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | Block-CoreCLREncryptionWarning 20 | ``` 21 | 22 | Creates the breadcrumb file to let PSGSuite know that you've acknowledged the CoreCLR encryption warning and it does not need to be displayed every time the module is imported 23 | 24 | ## PARAMETERS 25 | 26 | ## INPUTS 27 | 28 | ## OUTPUTS 29 | 30 | ## NOTES 31 | 32 | ## RELATED LINKS 33 | -------------------------------------------------------------------------------- /docs/pages/installation/powershell_gallery.md: -------------------------------------------------------------------------------- 1 | # Powershell Gallery 2 | 3 | * [PowerShell Gallery](https://www.powershellgallery.com/packages/PSGSuite) 4 | 5 | ## Powershell Gallery Requirements 6 | 7 | * [PowershellGet Module](https://learn.microsoft.com/en-us/powershell/module/powershellget/?view=powershellget-3.x) 8 | * Available in Windows 10 and later 9 | * Available in [Windows Management Framework 5.0](http://aka.ms/wmf5download) 10 | * Available in the PowerShell 3 and 4 MSI-based installer 11 | 12 | ???+ info 13 | 14 | Powershell Gallery versions might not include *all* pre-release versions. Please visit [GitHub Releases](../installation/github_releases.md) for versions that might not be available in the gallery. 15 | 16 | ```powershell {linenums="1"} 17 | Install-Module -Name PSGSuite -Scope CurrentUser 18 | ``` 19 | -------------------------------------------------------------------------------- /docs/.nav.yml: -------------------------------------------------------------------------------- 1 | nav: 2 | - PSGSuite: index.md 3 | - Installation: 4 | - Overview: pages/installation/overview.md 5 | - Powershell Gallery: pages/installation/powershell_gallery.md 6 | - GitHub Releases: pages/installation/github_releases.md 7 | - Building From Source: pages/installation/building_from_source.md 8 | - Configuration: 9 | - Google Cloud: pages/configuration/google_cloud_configuration.md 10 | - Module Configuration: pages/configuration/module_configuration.md 11 | - Examples: 12 | - User Management: pages/examples/user_management.md 13 | - License Management: pages/examples/license_management.md 14 | - Custom Schema Management: pages/examples/custom_schemas_management.md 15 | - Multi-Use Configuration: pages/examples/multi_use_configuration.md 16 | - Function Help: pages/function_help 17 | -------------------------------------------------------------------------------- /docs/pages/function_help/Configuration/Show-PSGSuiteConfig.md: -------------------------------------------------------------------------------- 1 | # Show-PSGSuiteConfig 2 | 3 | ## SYNOPSIS 4 | Returns the currently loaded config 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | Show-PSGSuiteConfig [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Returns the currently loaded config 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | Show-PSGSuiteConfig 20 | ``` 21 | 22 | ## PARAMETERS 23 | 24 | ### CommonParameters 25 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 26 | 27 | ## INPUTS 28 | 29 | ## OUTPUTS 30 | 31 | ## NOTES 32 | 33 | ## RELATED LINKS 34 | -------------------------------------------------------------------------------- /docs/pages/function_help/Helpers/Unblock-CoreCLREncryptionWarning.md: -------------------------------------------------------------------------------- 1 | # Unblock-CoreCLREncryptionWarning 2 | 3 | ## SYNOPSIS 4 | Unblocks CoreCLR encryption warning to ensure it appears if applicable (specific to PSGSuite) 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | Unblock-CoreCLREncryptionWarning 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Unblocks CoreCLR encryption warning to ensure it appears if applicable (specific to PSGSuite) by removing the following file if it exists: ~\.scrthq\BlockCoreCLREncryptionWarning.txt 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | Unblock-CoreCLREncryptionWarning 20 | ``` 21 | 22 | Removes the breadcrumb file to let PSGSuite know that you want to receive the CoreCLR encryption warning if applicable 23 | 24 | ## PARAMETERS 25 | 26 | ## INPUTS 27 | 28 | ## OUTPUTS 29 | 30 | ## NOTES 31 | 32 | ## RELATED LINKS 33 | -------------------------------------------------------------------------------- /PSGSuite/Public/Helpers/Unblock-CoreCLREncryptionWarning.ps1: -------------------------------------------------------------------------------- 1 | function Unblock-CoreCLREncryptionWarning { 2 | <# 3 | .SYNOPSIS 4 | Unblocks CoreCLR encryption warning to ensure it appears if applicable (specific to PSGSuite) 5 | 6 | .DESCRIPTION 7 | Unblocks CoreCLR encryption warning to ensure it appears if applicable (specific to PSGSuite) by removing the following file if it exists: ~\.scrthq\BlockCoreCLREncryptionWarning.txt 8 | 9 | .EXAMPLE 10 | Unblock-CoreCLREncryptionWarning 11 | 12 | Removes the breadcrumb file to let PSGSuite know that you want to receive the CoreCLR encryption warning if applicable 13 | #> 14 | if (Test-Path (Join-Path (Join-Path "~" ".scrthq") "BlockCoreCLREncryptionWarning.txt")) { 15 | Remove-Item -Path (Join-Path (Join-Path "~" ".scrthq") "BlockCoreCLREncryptionWarning.txt") -Force 16 | } 17 | } -------------------------------------------------------------------------------- /docs/pages/installation/github_releases.md: -------------------------------------------------------------------------------- 1 | # GitHub Releases Page 2 | 3 | ???+ info 4 | The GitHub releases page will likely be the same as the PowerShell Gallery. However, if you are looking for a specific version or a pre-release version, you may find it here first. 5 | 6 | ???+ warning 7 | You **must** have the module 'Configuration' installed as a prerequisite. Installing the module from the repo source or the release page does not automatically install dependencies. 8 | 9 | 1. Navigate to the [releases page](https://github.com/SCRT-HQ/PSGSuite/releases). 10 | 1. Expand `Assets` and download `PSGSuite.zip`. 11 | 1. Unblock the zip file before unzipping it - this is to prevent from having to unblock each file individually after unzipping. 12 | 13 | ```powershell {linenums="1"} 14 | Unblock-File -Path C:\Path\To\PSGSuite.zip -Verbose 15 | ``` 16 | 17 | 1. Unzip the archive. 18 | 1. Place the module somewhere in `$env:PSModulePath`. 19 | -------------------------------------------------------------------------------- /PSGSuite/Private/ListPrivate/Get-GSUserSchemaListPrivate.ps1: -------------------------------------------------------------------------------- 1 | function Get-GSUserSchemaListPrivate { 2 | [cmdletbinding()] 3 | Param( ) 4 | Begin { 5 | $serviceParams = @{ 6 | Scope = 'https://www.googleapis.com/auth/admin.directory.userschema' 7 | ServiceType = 'Google.Apis.Admin.Directory.directory_v1.DirectoryService' 8 | } 9 | $service = New-GoogleService @serviceParams 10 | } 11 | Process { 12 | try { 13 | $request = $service.Schemas.List($Script:PSGSuite.CustomerId) 14 | $result = $request.Execute() 15 | if ($null -ne $result.SchemasValue) { 16 | $result.SchemasValue 17 | } 18 | } 19 | catch { 20 | if ($ErrorActionPreference -eq 'Stop') { 21 | $PSCmdlet.ThrowTerminatingError($_) 22 | } 23 | else { 24 | Write-Error $_ 25 | } 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /PSGSuite/Private/Resolve-Email.ps1: -------------------------------------------------------------------------------- 1 | function Resolve-Email { 2 | [CmdletBinding()] 3 | Param ( 4 | [parameter(Mandatory,Position = 0,ValueFromPipeline,ValueFromPipelineByPropertyName)] 5 | [Ref[]] 6 | $Email, 7 | [parameter()] 8 | [Switch] 9 | $IsGroup 10 | ) 11 | Process { 12 | foreach ($e in $Email) { 13 | if (-not $IsGroup -and -not ($e.value -as [decimal])) { 14 | if ($e.value -ceq 'me') { 15 | $e.value = $Script:PSGSuite.AdminEmail 16 | } 17 | elseif ($e.value -notlike "*@*.*") { 18 | $e.value = "$($e.value)@$($Script:PSGSuite.Domain)" 19 | } 20 | } 21 | elseif ($IsGroup -and $e.value -cnotmatch '^([\w.%+-]+@[a-zA-Z\d.-]+\.[a-zA-Z]{2,}|\d{2}[a-z\d]{13})$') { 22 | $e.value = "$($e.value)@$($Script:PSGSuite.Domain)" 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /docs/pages/function_help/Drive/Stop-GSDriveFileUpload.md: -------------------------------------------------------------------------------- 1 | # Stop-GSDriveFileUpload 2 | 3 | ## SYNOPSIS 4 | Stops all Drive file uploads in progress and disposes of all streams. 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | Stop-GSDriveFileUpload [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Stops all Drive file uploads in progress and disposes of all streams. 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | Stop-GSDriveFileUpload 20 | ``` 21 | 22 | Stops all Drive file uploads in progress and disposes of all streams. 23 | 24 | ## PARAMETERS 25 | 26 | ### CommonParameters 27 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 28 | 29 | ## INPUTS 30 | 31 | ## OUTPUTS 32 | 33 | ## NOTES 34 | 35 | ## RELATED LINKS 36 | -------------------------------------------------------------------------------- /PSGSuite/Private/Read-MimeMessage.ps1: -------------------------------------------------------------------------------- 1 | function Read-MimeMessage { 2 | [cmdletbinding(DefaultParameterSetName = "String")] 3 | Param 4 | ( 5 | [parameter(Mandatory = $true,Position = 0,ValueFromPipeline = $true,ParameterSetName = "String")] 6 | [ValidateNotNullOrEmpty()] 7 | [string[]] 8 | $String, 9 | [parameter(Mandatory = $true,ValueFromPipeline = $true,ParameterSetName = "EmlFile")] 10 | [ValidateScript( {Test-Path $_})] 11 | [string[]] 12 | $EmlFile 13 | ) 14 | Process { 15 | switch ($PSCmdlet.ParameterSetName) { 16 | String { 17 | foreach ($str in $String) { 18 | $stream = [System.IO.MemoryStream]::new([Text.Encoding]::UTF8.GetBytes($str)) 19 | [MimeKit.MimeMessage]::Load($stream) 20 | $stream.Dispose() 21 | } 22 | } 23 | EmlFile { 24 | foreach ($str in $EmlFile) { 25 | [MimeKit.MimeMessage]::Load($str) 26 | } 27 | } 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /docs/pages/function_help/Authentication/Clear-PSGSuiteServiceCache.md: -------------------------------------------------------------------------------- 1 | # Clear-PSGSuiteServiceCache 2 | 3 | ## SYNOPSIS 4 | Clears the dictionary of cached service objects created with New-GoogleService. 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | Clear-PSGSuiteServiceCache [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Clears the dictionary of cached service objects created with New-GoogleService. 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | Clear-PSGSuiteServiceCache 20 | ``` 21 | 22 | ## PARAMETERS 23 | 24 | ### CommonParameters 25 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 26 | 27 | ## INPUTS 28 | 29 | ## OUTPUTS 30 | 31 | ## NOTES 32 | 33 | ## RELATED LINKS 34 | 35 | [https://psgsuite.io/Function%20Help/Authentication/Clear-PSGSuiteServiceCache/](https://psgsuite.io/Function%20Help/Authentication/Clear-PSGSuiteServiceCache/) 36 | 37 | -------------------------------------------------------------------------------- /docs/pages/installation/building_from_source.md: -------------------------------------------------------------------------------- 1 | # Building From Source 2 | 3 | ???+ danger 4 | This is intended for developers, contributors and bleeding edge fans. 5 | 6 | ???+ warning 7 | You **must** have the module 'Configuration' installed as a prerequisite. Installing the module from the repo source or the release page does not automatically install dependencies. 8 | 9 | 1. Clone the repo locally: 10 | 11 | ```{linenums="1"} 12 | git clone https://github.com/scrthq/PSGSuite.git 13 | ``` 14 | 15 | 1. Navigate to the cloned repo: 16 | 17 | ```{linenums="1"} 18 | cd \\path\to\PSGSuite 19 | ``` 20 | 21 | 1. To build the module locally to test changes run `build.ps1` at the root of the repo: 22 | 23 | ```powershell {linenums="1"} 24 | .\build.ps1 25 | ``` 26 | 27 | 1. To run the Pester tests locally to test changes run `build.ps1` with the `-Task` parameter set to `Test` at the root of the repo: 28 | 29 | ```powershell {linenums="1"} 30 | .\build.ps1 -Task Test 31 | ``` 32 | 33 | 1. Import the compiled module in a new session - from the root of the repo run the following: 34 | 35 | ```powershell {linenums="1"} 36 | Import-Module .\BuildOutput\PSGSuite -Force 37 | ``` 38 | -------------------------------------------------------------------------------- /docs/pages/function_help/Customers/Get-GSCustomer.md: -------------------------------------------------------------------------------- 1 | # Get-GSCustomer 2 | 3 | ## SYNOPSIS 4 | Retrieves a customer 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | Get-GSCustomer [[-CustomerKey] ] [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Retrieves a customer 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | Get-GSCustomer (Get-GSUser).CustomerId 20 | ``` 21 | 22 | ## PARAMETERS 23 | 24 | ### -CustomerKey 25 | Id of the Customer to be retrieved 26 | 27 | ```yaml 28 | Type: String 29 | Parameter Sets: (All) 30 | Aliases: CustomerId 31 | 32 | Required: False 33 | Position: 1 34 | Default value: $Script:PSGSuite.CustomerId 35 | Accept pipeline input: True (ByPropertyName, ByValue) 36 | Accept wildcard characters: False 37 | ``` 38 | 39 | ### CommonParameters 40 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 41 | 42 | ## INPUTS 43 | 44 | ## OUTPUTS 45 | 46 | ### Google.Apis.Admin.Directory.directory_v1.Data.Customer 47 | ## NOTES 48 | 49 | ## RELATED LINKS 50 | -------------------------------------------------------------------------------- /docs/pages/function_help/Domains/New-GSDomain.md: -------------------------------------------------------------------------------- 1 | # New-GSDomain 2 | 3 | ## SYNOPSIS 4 | Adds a new Domain 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | New-GSDomain [[-DomainName] ] [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Adds a new Domain 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | New-GSDDomain -DomainName 'testing.com' 20 | ``` 21 | 22 | Adds a new domain named 'testing.com' 23 | 24 | ## PARAMETERS 25 | 26 | ### -DomainName 27 | Name of the domain to add. 28 | 29 | ```yaml 30 | Type: String 31 | Parameter Sets: (All) 32 | Aliases: Domain 33 | 34 | Required: False 35 | Position: 1 36 | Default value: None 37 | Accept pipeline input: True (ByPropertyName, ByValue) 38 | Accept wildcard characters: False 39 | ``` 40 | 41 | ### CommonParameters 42 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 43 | 44 | ## INPUTS 45 | 46 | ## OUTPUTS 47 | 48 | ### Google.Apis.Admin.Directory.directory_v1.Data.Domains 49 | ## NOTES 50 | 51 | ## RELATED LINKS 52 | -------------------------------------------------------------------------------- /docs/pages/function_help/Domains/Get-GSDomain.md: -------------------------------------------------------------------------------- 1 | # Get-GSDomain 2 | 3 | ## SYNOPSIS 4 | Retrieves a Domain 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | Get-GSDomain [[-DomainName] ] [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Retrieves a Domain 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | Get-GSDDomain 20 | ``` 21 | 22 | Returns the list of domains. 23 | 24 | ## PARAMETERS 25 | 26 | ### -DomainName 27 | Name of the domain to retrieve. 28 | 29 | If excluded, returns the list of domains. 30 | 31 | ```yaml 32 | Type: String[] 33 | Parameter Sets: (All) 34 | Aliases: Domain 35 | 36 | Required: False 37 | Position: 1 38 | Default value: None 39 | Accept pipeline input: True (ByPropertyName, ByValue) 40 | Accept wildcard characters: False 41 | ``` 42 | 43 | ### CommonParameters 44 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 45 | 46 | ## INPUTS 47 | 48 | ## OUTPUTS 49 | 50 | ### Google.Apis.Admin.Directory.directory_v1.Data.Domains 51 | ## NOTES 52 | 53 | ## RELATED LINKS 54 | -------------------------------------------------------------------------------- /ci/UpdateNuGetDependenciesJson.ps1: -------------------------------------------------------------------------------- 1 | if ($items = Get-ChildItem (Resolve-Path $PSScriptRoot\..\BuildOutput\PSGSuite\*\lib -ErrorAction SilentlyContinue).Path -Filter '*.dll' | Where-Object {$_.BaseName -ne 'Google.Apis.Auth.PlatformServices'}) { 2 | $items | 3 | #Where-Object | 4 | Sort-Object BaseName | 5 | Select-Object Name, 6 | @{ 7 | N = 'BaseName' 8 | E = { 9 | if ($_.BaseName -eq 'BouncyCastle.Crypto') { 10 | 'BouncyCastle.Crypto.dll' 11 | } 12 | else { 13 | $_.BaseName 14 | } 15 | } 16 | }, 17 | @{ 18 | N='Target' 19 | E={ 20 | if ($_.BaseName -match 'BouncyCastle.Crypto') { 21 | '1.8.1' 22 | } 23 | else { 24 | 'Latest' 25 | } 26 | } 27 | }, 28 | @{ 29 | N='LatestVersion' 30 | E={ 31 | [System.Diagnostics.FileVersionInfo]::GetVersionInfo($_.FullName).ProductVersion 32 | } 33 | } | 34 | ConvertTo-Json | 35 | Set-Content (Join-Path $PSScriptRoot 'NuGetDependencies.json') -Force 36 | } 37 | -------------------------------------------------------------------------------- /docs/pages/function_help/Helpers/Compare-ModuleVersion.md: -------------------------------------------------------------------------------- 1 | # Compare-ModuleVersion 2 | 3 | ## SYNOPSIS 4 | Compares the installed version of a module with the latest version on the PowerShell Gallery 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | Compare-ModuleVersion [[-ModuleName] ] [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Compares the installed version of a module with the latest version on the PowerShell Gallery 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | Compare-ModuleVersion PSGSuite 20 | ``` 21 | 22 | ## PARAMETERS 23 | 24 | ### -ModuleName 25 | The name of the module to compare 26 | 27 | ```yaml 28 | Type: String[] 29 | Parameter Sets: (All) 30 | Aliases: 31 | 32 | Required: False 33 | Position: 1 34 | Default value: PSGSuite 35 | Accept pipeline input: False 36 | Accept wildcard characters: False 37 | ``` 38 | 39 | ### CommonParameters 40 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 41 | 42 | ## INPUTS 43 | 44 | ## OUTPUTS 45 | 46 | ## NOTES 47 | 48 | ## RELATED LINKS 49 | -------------------------------------------------------------------------------- /PSGSuite/Private/Read-Prompt.ps1: -------------------------------------------------------------------------------- 1 | function Read-Prompt { 2 | [CmdletBinding()] 3 | Param 4 | ( 5 | [parameter(Mandatory = $true,Position = 0)] 6 | $Options, 7 | [parameter(Mandatory = $false)] 8 | [String] 9 | $Title = "Picky Choosy Time", 10 | [parameter(Mandatory = $false)] 11 | [String] 12 | $Message = "Which do you prefer?", 13 | [parameter(Mandatory = $false)] 14 | [Int] 15 | $Default = 0 16 | ) 17 | Process { 18 | $opt = @() 19 | foreach ($option in $Options) { 20 | switch ($option.GetType().Name) { 21 | Hashtable { 22 | foreach ($key in $option.Keys) { 23 | $opt += New-Object System.Management.Automation.Host.ChoiceDescription "$($key)","$($option[$key])" 24 | } 25 | } 26 | String { 27 | $opt += New-Object System.Management.Automation.Host.ChoiceDescription "$option",$null 28 | } 29 | } 30 | } 31 | $choices = [System.Management.Automation.Host.ChoiceDescription[]] $opt 32 | $answer = $host.ui.PromptForChoice($Title, $Message, $choices, $Default) 33 | $choices[$answer].Label -replace "&" 34 | } 35 | } -------------------------------------------------------------------------------- /docs/pages/function_help/Gmail/Get-GSGmailPopSettings.md: -------------------------------------------------------------------------------- 1 | # Get-GSGmailPopSettings 2 | 3 | ## SYNOPSIS 4 | Gets POP settings 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | Get-GSGmailPopSettings [[-User] ] [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Gets POP settings 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | Get-GSGmailPopSettings 20 | ``` 21 | 22 | Gets the POP settings for the AdminEmail user 23 | 24 | ## PARAMETERS 25 | 26 | ### -User 27 | The user to get the POP settings for 28 | 29 | Defaults to the AdminEmail user 30 | 31 | ```yaml 32 | Type: String 33 | Parameter Sets: (All) 34 | Aliases: PrimaryEmail, UserKey, Mail 35 | 36 | Required: False 37 | Position: 1 38 | Default value: $Script:PSGSuite.AdminEmail 39 | Accept pipeline input: True (ByPropertyName) 40 | Accept wildcard characters: False 41 | ``` 42 | 43 | ### CommonParameters 44 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 45 | 46 | ## INPUTS 47 | 48 | ## OUTPUTS 49 | 50 | ### Google.Apis.Gmail.v1.Data.PopSettings 51 | ## NOTES 52 | 53 | ## RELATED LINKS 54 | -------------------------------------------------------------------------------- /docs/pages/function_help/Gmail/Get-GSGmailProfile.md: -------------------------------------------------------------------------------- 1 | # Get-GSGmailProfile 2 | 3 | ## SYNOPSIS 4 | Gets Gmail profile for the user 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | Get-GSGmailProfile [[-User] ] [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Gets Gmail profile for the user 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | Get-GSGmailProfile 20 | ``` 21 | 22 | Gets the Gmail profile of the AdminEmail user 23 | 24 | ## PARAMETERS 25 | 26 | ### -User 27 | The user to get profile of 28 | 29 | Defaults to the AdminEmail user 30 | 31 | ```yaml 32 | Type: String[] 33 | Parameter Sets: (All) 34 | Aliases: PrimaryEmail, UserKey, Mail 35 | 36 | Required: False 37 | Position: 1 38 | Default value: $Script:PSGSuite.AdminEmail 39 | Accept pipeline input: True (ByPropertyName) 40 | Accept wildcard characters: False 41 | ``` 42 | 43 | ### CommonParameters 44 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 45 | 46 | ## INPUTS 47 | 48 | ## OUTPUTS 49 | 50 | ### Google.Apis.Gmail.v1.Data.Profile 51 | ## NOTES 52 | 53 | ## RELATED LINKS 54 | -------------------------------------------------------------------------------- /docs/pages/function_help/Gmail/Get-GSGmailImapSettings.md: -------------------------------------------------------------------------------- 1 | # Get-GSGmailImapSettings 2 | 3 | ## SYNOPSIS 4 | Gets IMAP settings 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | Get-GSGmailImapSettings [[-User] ] [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Gets IMAP settings 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | Get-GSGmailImapSettings 20 | ``` 21 | 22 | Gets the IMAP settings for the AdminEmail user 23 | 24 | ## PARAMETERS 25 | 26 | ### -User 27 | The user to get the IMAP settings for 28 | 29 | Defaults to the AdminEmail user 30 | 31 | ```yaml 32 | Type: String 33 | Parameter Sets: (All) 34 | Aliases: PrimaryEmail, UserKey, Mail 35 | 36 | Required: False 37 | Position: 1 38 | Default value: $Script:PSGSuite.AdminEmail 39 | Accept pipeline input: True (ByPropertyName) 40 | Accept wildcard characters: False 41 | ``` 42 | 43 | ### CommonParameters 44 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 45 | 46 | ## INPUTS 47 | 48 | ## OUTPUTS 49 | 50 | ### Google.Apis.Gmail.v1.Data.ImapSettings 51 | ## NOTES 52 | 53 | ## RELATED LINKS 54 | -------------------------------------------------------------------------------- /PSGSuite/Public/Authentication/Clear-PSGSuiteServiceCache.ps1: -------------------------------------------------------------------------------- 1 | function Clear-PSGSuiteServiceCache { 2 | <# 3 | .SYNOPSIS 4 | Clears the dictionary of cached service objects created with New-GoogleService. 5 | 6 | .DESCRIPTION 7 | Clears the dictionary of cached service objects created with New-GoogleService. 8 | 9 | .EXAMPLE 10 | Clear-PSGSuiteServiceCache 11 | 12 | .LINK 13 | https://psgsuite.io/Function%20Help/Authentication/Clear-PSGSuiteServiceCache/ 14 | #> 15 | [CmdletBinding()] 16 | Param () 17 | Begin{ 18 | if (-not $script:_PSGSuiteSessions) { 19 | $script:_PSGSuiteSessions = @{} 20 | } 21 | $toRemove = @() 22 | } 23 | Process { 24 | if (-not $script:_PSGSuiteSessions.Keys.Count) { 25 | Write-Verbose "There are no current cached sessions to clear!" 26 | } 27 | else { 28 | foreach ($key in $script:_PSGSuiteSessions.Keys) { 29 | Write-Verbose "Clearing cached session with key: $key" 30 | $script:_PSGSuiteSessions[$key].Service.Dispose() 31 | $toRemove += $key 32 | } 33 | } 34 | } 35 | End { 36 | foreach ($key in $toRemove) { 37 | $script:_PSGSuiteSessions.Remove($key) 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /docs/pages/function_help/Schemas/Get-GSUserSchema.md: -------------------------------------------------------------------------------- 1 | # Get-GSUserSchema 2 | 3 | ## SYNOPSIS 4 | Gets custom user schema info 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | Get-GSUserSchema [[-SchemaId] ] [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Gets custom user schema info 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | Get-GSUserSchema 20 | ``` 21 | 22 | Gets the list of custom user schemas 23 | 24 | ## PARAMETERS 25 | 26 | ### -SchemaId 27 | The Id or Name of the user schema you would like to return info for. 28 | If excluded, gets the full list of user schemas 29 | 30 | ```yaml 31 | Type: String[] 32 | Parameter Sets: (All) 33 | Aliases: Schema 34 | 35 | Required: False 36 | Position: 1 37 | Default value: None 38 | Accept pipeline input: True (ByPropertyName) 39 | Accept wildcard characters: False 40 | ``` 41 | 42 | ### CommonParameters 43 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 44 | 45 | ## INPUTS 46 | 47 | ## OUTPUTS 48 | 49 | ### Google.Apis.Admin.Directory.directory_v1.Data.Schema 50 | ## NOTES 51 | 52 | ## RELATED LINKS 53 | -------------------------------------------------------------------------------- /docs/pages/function_help/Chat/Get-GSChatMessage.md: -------------------------------------------------------------------------------- 1 | # Get-GSChatMessage 2 | 3 | ## SYNOPSIS 4 | Gets a Chat message 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | Get-GSChatMessage [-Name] [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Gets a Chat message 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | Get-GSChatMessage -Name 'spaces/AAAAMpdlehY/messages/UMxbHmzDlr4.UMxbHmzDlr4' 20 | ``` 21 | 22 | Gets the Chat message specified 23 | 24 | ## PARAMETERS 25 | 26 | ### -Name 27 | Resource name of the message to be retrieved, in the form "spaces/messages". 28 | 29 | Example: spaces/AAAAMpdlehY/messages/UMxbHmzDlr4.UMxbHmzDlr4 30 | 31 | ```yaml 32 | Type: String[] 33 | Parameter Sets: (All) 34 | Aliases: Id 35 | 36 | Required: True 37 | Position: 1 38 | Default value: None 39 | Accept pipeline input: False 40 | Accept wildcard characters: False 41 | ``` 42 | 43 | ### CommonParameters 44 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 45 | 46 | ## INPUTS 47 | 48 | ## OUTPUTS 49 | 50 | ### Google.Apis.HangoutsChat.v1.Data.Message 51 | ## NOTES 52 | 53 | ## RELATED LINKS 54 | -------------------------------------------------------------------------------- /docs/pages/function_help/Gmail/Get-GSGmailVacationSettings.md: -------------------------------------------------------------------------------- 1 | # Get-GSGmailVacationSettings 2 | 3 | ## SYNOPSIS 4 | Gets Vacation settings 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | Get-GSGmailVacationSettings [[-User] ] [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Gets Vacation settings 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | Get-GSGmailVacationSettings 20 | ``` 21 | 22 | Gets the Vacation settings for the AdminEmail user 23 | 24 | ## PARAMETERS 25 | 26 | ### -User 27 | The user to get the Vacation settings for 28 | 29 | Defaults to the AdminEmail user 30 | 31 | ```yaml 32 | Type: String 33 | Parameter Sets: (All) 34 | Aliases: PrimaryEmail, UserKey, Mail 35 | 36 | Required: False 37 | Position: 1 38 | Default value: $Script:PSGSuite.AdminEmail 39 | Accept pipeline input: True (ByPropertyName) 40 | Accept wildcard characters: False 41 | ``` 42 | 43 | ### CommonParameters 44 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 45 | 46 | ## INPUTS 47 | 48 | ## OUTPUTS 49 | 50 | ### Google.Apis.Gmail.v1.Data.VacationSettings 51 | ## NOTES 52 | 53 | ## RELATED LINKS 54 | -------------------------------------------------------------------------------- /docs/pages/function_help/Chat/Get-GSChatSpace.md: -------------------------------------------------------------------------------- 1 | # Get-GSChatSpace 2 | 3 | ## SYNOPSIS 4 | Gets a Chat space 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | Get-GSChatSpace [[-Space] ] [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Gets a Chat space 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | Get-GSChatSpace 20 | ``` 21 | 22 | Gets the list of Chat spaces the bot is a member of 23 | 24 | ## PARAMETERS 25 | 26 | ### -Space 27 | The resource name of the space for which membership list is to be fetched, in the form "spaces". 28 | 29 | If left blank, returns the list of spaces the bot is a member of 30 | 31 | Example: spaces/AAAAMpdlehY 32 | 33 | ```yaml 34 | Type: String[] 35 | Parameter Sets: (All) 36 | Aliases: Name 37 | 38 | Required: False 39 | Position: 1 40 | Default value: None 41 | Accept pipeline input: True (ByPropertyName) 42 | Accept wildcard characters: False 43 | ``` 44 | 45 | ### CommonParameters 46 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 47 | 48 | ## INPUTS 49 | 50 | ## OUTPUTS 51 | 52 | ### Google.Apis.HangoutsChat.v1.Data.Space 53 | ## NOTES 54 | 55 | ## RELATED LINKS 56 | -------------------------------------------------------------------------------- /docs/pages/function_help/Groups/Get-GSGroupSettings.md: -------------------------------------------------------------------------------- 1 | # Get-GSGroupSettings 2 | 3 | ## SYNOPSIS 4 | Gets a group's settings 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | Get-GSGroupSettings [-Identity] [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Gets a group's settings 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | Get-GSGroupSettings admins 20 | ``` 21 | 22 | Gets the group settings for admins@domain.com 23 | 24 | ## PARAMETERS 25 | 26 | ### -Identity 27 | The email of the group 28 | 29 | If only the email name-part is passed, the full email will be contstructed using the Domain from the active config 30 | 31 | ```yaml 32 | Type: String[] 33 | Parameter Sets: (All) 34 | Aliases: GroupEmail, Group, Email 35 | 36 | Required: True 37 | Position: 1 38 | Default value: None 39 | Accept pipeline input: True (ByPropertyName, ByValue) 40 | Accept wildcard characters: False 41 | ``` 42 | 43 | ### CommonParameters 44 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 45 | 46 | ## INPUTS 47 | 48 | ## OUTPUTS 49 | 50 | ### Google.Apis.Groupssettings.v1.Data.Groups 51 | ## NOTES 52 | 53 | ## RELATED LINKS 54 | -------------------------------------------------------------------------------- /docs/pages/function_help/Security/Revoke-GSUserVerificationCodes.md: -------------------------------------------------------------------------------- 1 | # Revoke-GSUserVerificationCodes 2 | 3 | ## SYNOPSIS 4 | Revokes/invalidates Verification Codes for the user 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | Revoke-GSUserVerificationCodes [[-User] ] [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Revokes/invalidates Verification Codes for the user 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | Revoke-GSUserVerificationCodes -User me -Confirm:$false 20 | ``` 21 | 22 | Invalidates the verification codes for the AdminEmail user, skipping confirmation 23 | 24 | ## PARAMETERS 25 | 26 | ### -User 27 | The user to revoke verification codes from 28 | 29 | ```yaml 30 | Type: String[] 31 | Parameter Sets: (All) 32 | Aliases: PrimaryEmail, UserKey, Mail 33 | 34 | Required: False 35 | Position: 1 36 | Default value: None 37 | Accept pipeline input: True (ByPropertyName, ByValue) 38 | Accept wildcard characters: False 39 | ``` 40 | 41 | ### CommonParameters 42 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 43 | 44 | ## INPUTS 45 | 46 | ## OUTPUTS 47 | 48 | ## NOTES 49 | 50 | ## RELATED LINKS 51 | -------------------------------------------------------------------------------- /docs/pages/function_help/Gmail/Get-GSGmailAutoForwardingSettings.md: -------------------------------------------------------------------------------- 1 | # Get-GSGmailAutoForwardingSettings 2 | 3 | ## SYNOPSIS 4 | Gets AutoForwarding settings 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | Get-GSGmailAutoForwardingSettings [[-User] ] [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Gets AutoForwarding settings 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | Get-GSGmailAutoForwardingSettings 20 | ``` 21 | 22 | Gets the AutoForwarding settings for the AdminEmail user 23 | 24 | ## PARAMETERS 25 | 26 | ### -User 27 | The user to get the AutoForwarding settings for 28 | 29 | Defaults to the AdminEmail user 30 | 31 | ```yaml 32 | Type: String 33 | Parameter Sets: (All) 34 | Aliases: PrimaryEmail, UserKey, Mail 35 | 36 | Required: False 37 | Position: 1 38 | Default value: $Script:PSGSuite.AdminEmail 39 | Accept pipeline input: True (ByPropertyName) 40 | Accept wildcard characters: False 41 | ``` 42 | 43 | ### CommonParameters 44 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 45 | 46 | ## INPUTS 47 | 48 | ## OUTPUTS 49 | 50 | ### Google.Apis.Gmail.v1.Data.AutoForwarding 51 | ## NOTES 52 | 53 | ## RELATED LINKS 54 | -------------------------------------------------------------------------------- /docs/pages/function_help/Contacts/Get-GSContactList.md: -------------------------------------------------------------------------------- 1 | # Get-GSContactList 2 | 3 | ## SYNOPSIS 4 | Gets all contacts for the specified user 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | Get-GSContactList [[-User] ] [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Gets all contacts for the specified user 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | Get-GSContactList -User user@domain.com 20 | ``` 21 | 22 | ## PARAMETERS 23 | 24 | ### -User 25 | The primary email or UserID of the user. 26 | You can exclude the '@domain.com' to insert the Domain in the config or use the special 'me' to indicate the AdminEmail in the config. 27 | 28 | Defaults to the AdminEmail in the config. 29 | 30 | ```yaml 31 | Type: String[] 32 | Parameter Sets: (All) 33 | Aliases: PrimaryEmail, UserKey, Mail 34 | 35 | Required: False 36 | Position: 1 37 | Default value: $Script:PSGSuite.AdminEmail 38 | Accept pipeline input: True (ByPropertyName) 39 | Accept wildcard characters: False 40 | ``` 41 | 42 | ### CommonParameters 43 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 44 | 45 | ## INPUTS 46 | 47 | ## OUTPUTS 48 | 49 | ## NOTES 50 | 51 | ## RELATED LINKS 52 | -------------------------------------------------------------------------------- /docs/pages/function_help/Gmail/Get-GSGmailLanguageSettings.md: -------------------------------------------------------------------------------- 1 | # Get-GSGmailLanguageSettings 2 | 3 | ## SYNOPSIS 4 | Gets Gmail display language settings 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | Get-GSGmailLanguageSettings [[-User] ] [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Gets Gmail display language settings 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | Get-GSGmailLanguageSettings -User me 20 | ``` 21 | 22 | Gets the Gmail display language for the AdminEmail user. 23 | 24 | ## PARAMETERS 25 | 26 | ### -User 27 | The user to get the Gmail display language settings for. 28 | 29 | Defaults to the AdminEmail user. 30 | 31 | ```yaml 32 | Type: String[] 33 | Parameter Sets: (All) 34 | Aliases: PrimaryEmail, UserKey, Mail 35 | 36 | Required: False 37 | Position: 1 38 | Default value: $Script:PSGSuite.AdminEmail 39 | Accept pipeline input: True (ByPropertyName) 40 | Accept wildcard characters: False 41 | ``` 42 | 43 | ### CommonParameters 44 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 45 | 46 | ## INPUTS 47 | 48 | ## OUTPUTS 49 | 50 | ### Google.Apis.Gmail.v1.Data.LanguageSettings 51 | ## NOTES 52 | 53 | ## RELATED LINKS 54 | -------------------------------------------------------------------------------- /PSGSuite/Public/Customers/Get-GSCustomer.ps1: -------------------------------------------------------------------------------- 1 | function Get-GSCustomer { 2 | <# 3 | .SYNOPSIS 4 | Retrieves a customer 5 | 6 | .DESCRIPTION 7 | Retrieves a customer 8 | 9 | .PARAMETER CustomerKey 10 | Id of the Customer to be retrieved 11 | 12 | .EXAMPLE 13 | Get-GSCustomer (Get-GSUser).CustomerId 14 | #> 15 | [OutputType('Google.Apis.Admin.Directory.directory_v1.Data.Customer')] 16 | [CmdletBinding()] 17 | Param( 18 | [Parameter(Position = 0,ValueFromPipeline,ValueFromPipelineByPropertyName)] 19 | [Alias('CustomerId')] 20 | [String] 21 | $CustomerKey = $Script:PSGSuite.CustomerId 22 | ) 23 | Begin { 24 | $serviceParams = @{ 25 | Scope = 'https://www.googleapis.com/auth/admin.directory.customer' 26 | ServiceType = 'Google.Apis.Admin.Directory.directory_v1.DirectoryService' 27 | } 28 | $service = New-GoogleService @serviceParams 29 | } 30 | Process { 31 | try { 32 | Write-Verbose "Getting Customer '$CustomerKey'" 33 | $request = $service.Customers.Get($CustomerKey) 34 | $request.Execute() 35 | } 36 | catch { 37 | if ($ErrorActionPreference -eq 'Stop') { 38 | $PSCmdlet.ThrowTerminatingError($_) 39 | } 40 | else { 41 | Write-Error $_ 42 | } 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /docs/pages/examples/multi_use_configuration.md: -------------------------------------------------------------------------------- 1 | # Multi-Use Configuration 2 | 3 | PSGSuite 2.0.0 and later uses a single file configuration stored outside of the module folder. The file is normally located in `$env:LOCALAPPDATA\powershell\SCRT HQ\PSGSuite\Configuration.psd1`. 4 | 5 | If you intend to use the module with more than one user account on the same machine, you will want to create your configuration with an AES key as the encryption method. To do this you'll want to create a key then pass the key as the first argument when importing the module. 6 | 7 | !!! danger 8 | You **must** pass `$null` after the `$key` argument as shown to force the full key to be used, otherwise only the first byte in the array will be passed as the key value 9 | 10 | ```powershell {linenums="1"} 11 | $key = [byte[]]::new(32) # 32 bytes for AES-256 12 | [Security.Cryptography.RandomNumberGenerator]::Create().GetBytes($key) 13 | 14 | Import-Module PSGSuite -ArgumentList $key,$null 15 | 16 | $props = @{ 17 | ConfigName = 'MyMultiUseConfig' 18 | P12KeyPath = '\\path\to\your\p12key.p12' 19 | AppEmail = 'service_account_email' 20 | AdminEmail = 'admin_email' 21 | CustomerID = 'customer_id' 22 | Domain = "domain.com" 23 | Preference = "CustomerID" 24 | ServiceAccountClientID = "service_account_client_id" 25 | } 26 | 27 | Set-PSGSuiteConfig @props 28 | ``` 29 | -------------------------------------------------------------------------------- /docs/pages/function_help/Groups/Get-GSGroupAlias.md: -------------------------------------------------------------------------------- 1 | # Get-GSGroupAlias 2 | 3 | ## SYNOPSIS 4 | Gets the specified G SUite Group's aliases 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | Get-GSGroupAlias [-Group] [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Gets the specified G SUite Group's aliases 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | Get-GSGroupAlias -Group hr 20 | ``` 21 | 22 | Gets the list of aliases for the group hr@domain.com 23 | 24 | ## PARAMETERS 25 | 26 | ### -Group 27 | The primary email or ID of the group who you are trying to get aliases for. 28 | You can exclude the '@domain.com' to insert the Domain in the config or use the special 'me' to indicate the AdminEmail in the config. 29 | 30 | ```yaml 31 | Type: String[] 32 | Parameter Sets: (All) 33 | Aliases: Email 34 | 35 | Required: True 36 | Position: 1 37 | Default value: None 38 | Accept pipeline input: True (ByPropertyName, ByValue) 39 | Accept wildcard characters: False 40 | ``` 41 | 42 | ### CommonParameters 43 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 44 | 45 | ## INPUTS 46 | 47 | ## OUTPUTS 48 | 49 | ### Google.Apis.Admin.Directory.directory_v1.Data.Alias 50 | ## NOTES 51 | 52 | ## RELATED LINKS 53 | -------------------------------------------------------------------------------- /PSGSuite/Public/Authentication/Get-PSGSuiteServiceCache.ps1: -------------------------------------------------------------------------------- 1 | function Get-PSGSuiteServiceCache { 2 | <# 3 | .SYNOPSIS 4 | Returns the dictionary of cached service objects created with New-GoogleService for inspection. 5 | 6 | .DESCRIPTION 7 | Returns the dictionary of cached service objects created with New-GoogleService for inspection. 8 | 9 | The keys in the session cache dictionary are comprised of the following values which are added to the cache whenever a new session is created: 10 | 11 | $SessionKey = @($User,$ServiceType,$(($Scope | Sort-Object) -join ";")) -join ";" 12 | 13 | .PARAMETER IncludeKeys 14 | If $true, returns the full service cache dictionary including keys. 15 | 16 | Defaults to $false. 17 | 18 | .EXAMPLE 19 | Get-PSGSuiteServiceCache 20 | 21 | .LINK 22 | https://psgsuite.io/Function%20Help/Authentication/Get-PSGSuiteServiceCache/ 23 | #> 24 | [CmdletBinding()] 25 | Param ( 26 | [parameter(Mandatory = $false,Position = 0)] 27 | [Switch] 28 | $IncludeKeys 29 | ) 30 | Begin{ 31 | if (-not $script:_PSGSuiteSessions) { 32 | $script:_PSGSuiteSessions = @{} 33 | } 34 | } 35 | Process { 36 | Write-Verbose "Getting cached session list" 37 | if ($IncludeKeys) { 38 | $script:_PSGSuiteSessions 39 | } 40 | else { 41 | $script:_PSGSuiteSessions.Values 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /PSGSuite/Private/Get-MimeType.ps1: -------------------------------------------------------------------------------- 1 | function Get-MimeType { 2 | Param 3 | ( 4 | [parameter(Mandatory=$true, ValueFromPipeline=$true,Position = 0)] 5 | [System.IO.FileInfo] 6 | $File 7 | ) 8 | $mimeHash = @{ 9 | arj = 'application/arj' 10 | bmp = 'image/bmp' 11 | cab = 'application/cab' 12 | csv = 'text/plain' 13 | doc = 'application/msword' 14 | gif = 'image/gif' 15 | htm = 'text/html' 16 | html = 'text/html' 17 | jpg = 'image/jpeg' 18 | js = 'text/js' 19 | log = 'text/plain' 20 | md = 'text/plain' 21 | mp3 = 'audio/mpeg' 22 | ods = 'application/vnd.oasis.opendocument.spreadsheet' 23 | pdf = 'application/pdf' 24 | php = 'application/x-httpd-php' 25 | png = 'image/png' 26 | rar = 'application/rar' 27 | swf = 'application/x-shockwave-flash' 28 | tar = 'application/tar' 29 | tmpl = 'text/plain' 30 | txt = 'text/plain' 31 | xls = 'application/vnd.ms-excel' 32 | xlsx = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' 33 | xml = 'text/xml' 34 | zip = 'application/zip' 35 | } 36 | if ($File.PSIsContainer) { 37 | 'application/vnd.google-apps.folder' 38 | } 39 | elseif ($mime = $mimeHash["$($file.Extension.TrimStart('.'))"]) { 40 | $mime 41 | } 42 | else { 43 | 'application/octet-stream' 44 | } 45 | } -------------------------------------------------------------------------------- /docs/pages/function_help/Users/Get-GSUserAlias.md: -------------------------------------------------------------------------------- 1 | # Get-GSUserAlias 2 | 3 | ## SYNOPSIS 4 | Gets the specified G SUite User's aliases 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | Get-GSUserAlias [[-User] ] [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Gets the specified G SUite User's aliases 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | Get-GSUserAlias 20 | ``` 21 | 22 | Gets the list of aliases for the AdminEmail user 23 | 24 | ## PARAMETERS 25 | 26 | ### -User 27 | The primary email or UserID of the user who you are trying to get aliases for. 28 | You can exclude the '@domain.com' to insert the Domain in the config or use the special 'me' to indicate the AdminEmail in the config. 29 | 30 | Defaults to the AdminEmail in the config 31 | 32 | ```yaml 33 | Type: String[] 34 | Parameter Sets: (All) 35 | Aliases: PrimaryEmail, UserKey, Mail, Email 36 | 37 | Required: False 38 | Position: 1 39 | Default value: $Script:PSGSuite.AdminEmail 40 | Accept pipeline input: True (ByPropertyName) 41 | Accept wildcard characters: False 42 | ``` 43 | 44 | ### CommonParameters 45 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 46 | 47 | ## INPUTS 48 | 49 | ## OUTPUTS 50 | 51 | ### Google.Apis.Admin.Directory.directory_v1.Data.Alias 52 | ## NOTES 53 | 54 | ## RELATED LINKS 55 | -------------------------------------------------------------------------------- /docs/pages/function_help/Security/New-GSUserVerificationCodes.md: -------------------------------------------------------------------------------- 1 | # New-GSUserVerificationCodes 2 | 3 | ## SYNOPSIS 4 | Generates new verification codes for the user 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | New-GSUserVerificationCodes [-User] [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Generates new verification codes for the user 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | New-GSUserVerificationCodes -User me 20 | ``` 21 | 22 | Generates new verification codes for the AdminEmail user 23 | 24 | ## PARAMETERS 25 | 26 | ### -User 27 | The primary email or UserID of the user who you are trying to get info for. 28 | You can exclude the '@domain.com' to insert the Domain in the config or use the special 'me' to indicate the AdminEmail in the config 29 | 30 | ```yaml 31 | Type: String[] 32 | Parameter Sets: (All) 33 | Aliases: PrimaryEmail, UserKey, Mail 34 | 35 | Required: True 36 | Position: 1 37 | Default value: None 38 | Accept pipeline input: True (ByPropertyName, ByValue) 39 | Accept wildcard characters: False 40 | ``` 41 | 42 | ### CommonParameters 43 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 44 | 45 | ## INPUTS 46 | 47 | ## OUTPUTS 48 | 49 | ### Google.Apis.Admin.Directory.directory_v1.Data.VerificationCode 50 | ## NOTES 51 | 52 | ## RELATED LINKS 53 | -------------------------------------------------------------------------------- /PSGSuite/Public/Drive/Stop-GSDriveFileUpload.ps1: -------------------------------------------------------------------------------- 1 | function Stop-GSDriveFileUpload { 2 | <# 3 | .SYNOPSIS 4 | Stops all Drive file uploads in progress and disposes of all streams. 5 | 6 | .DESCRIPTION 7 | Stops all Drive file uploads in progress and disposes of all streams. 8 | 9 | .PARAMETER Successful 10 | If $true, hides any failed task verbose output 11 | 12 | .EXAMPLE 13 | Stop-GSDriveFileUpload 14 | 15 | Stops all Drive file uploads in progress and disposes of all streams. 16 | #> 17 | [cmdletbinding()] 18 | Param ( 19 | [Parameter(DontShow)] 20 | [Switch] 21 | $Successful 22 | ) 23 | Begin { 24 | Write-Verbose "Stopping all remaining Drive file uploads!" 25 | } 26 | Process { 27 | foreach ($task in $script:DriveUploadTasks | Where-Object {$_.Stream -and -not $_.StreamDisposed}) { 28 | try { 29 | if (-not $Successful) { 30 | $progress = {$task.Request.GetProgress()}.InvokeReturnAsIs() 31 | Write-Verbose "[$($progress.Status)] Stopping stream of Task Id [$($task.Id)] | File [$($task.File.FullName)]" 32 | } 33 | $task.Stream.Dispose() 34 | $task.StreamDisposed = $true 35 | } 36 | catch { 37 | if ($ErrorActionPreference -eq 'Stop') { 38 | $PSCmdlet.ThrowTerminatingError($_) 39 | } 40 | else { 41 | Write-Error $_ 42 | } 43 | } 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /docs/pages/function_help/Security/Get-GSUserVerificationCodes.md: -------------------------------------------------------------------------------- 1 | # Get-GSUserVerificationCodes 2 | 3 | ## SYNOPSIS 4 | Gets the 2-Step Verification Codes for the user 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | Get-GSUserVerificationCodes [[-User] ] [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Gets the 2-Step Verification Codes for the user 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | Get-GSUserVerificationCodes 20 | ``` 21 | 22 | Gets the Verification Codes for AdminEmail user 23 | 24 | ## PARAMETERS 25 | 26 | ### -User 27 | The primary email or UserID of the user who you are trying to get info for. 28 | You can exclude the '@domain.com' to insert the Domain in the config or use the special 'me' to indicate the AdminEmail in the config. 29 | 30 | Defaults to the AdminEmail in the config 31 | 32 | ```yaml 33 | Type: String[] 34 | Parameter Sets: (All) 35 | Aliases: PrimaryEmail, UserKey, Mail 36 | 37 | Required: False 38 | Position: 1 39 | Default value: $Script:PSGSuite.AdminEmail 40 | Accept pipeline input: True (ByPropertyName, ByValue) 41 | Accept wildcard characters: False 42 | ``` 43 | 44 | ### CommonParameters 45 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 46 | 47 | ## INPUTS 48 | 49 | ## OUTPUTS 50 | 51 | ### Google.Apis.Admin.Directory.directory_v1.Data.VerificationCode 52 | ## NOTES 53 | 54 | ## RELATED LINKS 55 | -------------------------------------------------------------------------------- /PSGSuite/Public/Chat/Get-GSChatMessage.ps1: -------------------------------------------------------------------------------- 1 | function Get-GSChatMessage { 2 | <# 3 | .SYNOPSIS 4 | Gets a Chat message 5 | 6 | .DESCRIPTION 7 | Gets a Chat message 8 | 9 | .PARAMETER Name 10 | Resource name of the message to be retrieved, in the form "spaces/messages". 11 | 12 | Example: spaces/AAAAMpdlehY/messages/UMxbHmzDlr4.UMxbHmzDlr4 13 | 14 | .EXAMPLE 15 | Get-GSChatMessage -Name 'spaces/AAAAMpdlehY/messages/UMxbHmzDlr4.UMxbHmzDlr4' 16 | 17 | Gets the Chat message specified 18 | #> 19 | [OutputType('Google.Apis.HangoutsChat.v1.Data.Message')] 20 | [cmdletbinding()] 21 | Param 22 | ( 23 | [parameter(Mandatory = $true,Position = 0)] 24 | [Alias('Id')] 25 | [string[]] 26 | $Name 27 | ) 28 | Begin { 29 | $serviceParams = @{ 30 | Scope = 'https://www.googleapis.com/auth/chat.bot' 31 | ServiceType = 'Google.Apis.HangoutsChat.v1.HangoutsChatService' 32 | } 33 | $service = New-GoogleService @serviceParams 34 | } 35 | Process { 36 | foreach ($msg in $Name) { 37 | try { 38 | $request = $service.Spaces.Messages.Get($msg) 39 | Write-Verbose "Getting Message '$msg'" 40 | $request.Execute() 41 | } 42 | catch { 43 | if ($ErrorActionPreference -eq 'Stop') { 44 | $PSCmdlet.ThrowTerminatingError($_) 45 | } 46 | else { 47 | Write-Error $_ 48 | } 49 | } 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /PSGSuite/Public/Domains/New-GSDomain.ps1: -------------------------------------------------------------------------------- 1 | function New-GSDomain { 2 | <# 3 | .SYNOPSIS 4 | Adds a new Domain 5 | 6 | .DESCRIPTION 7 | Adds a new Domain 8 | 9 | .PARAMETER DomainName 10 | Name of the domain to add. 11 | 12 | .EXAMPLE 13 | New-GSDDomain -DomainName 'testing.com' 14 | 15 | Adds a new domain named 'testing.com' 16 | #> 17 | [OutputType('Google.Apis.Admin.Directory.directory_v1.Data.Domains')] 18 | [CmdletBinding()] 19 | Param( 20 | [Parameter(Position = 0,ValueFromPipeline,ValueFromPipelineByPropertyName)] 21 | [Alias('Domain')] 22 | [String] 23 | $DomainName 24 | ) 25 | Begin { 26 | $serviceParams = @{ 27 | Scope = 'https://www.googleapis.com/auth/admin.directory.domain' 28 | ServiceType = 'Google.Apis.Admin.Directory.directory_v1.DirectoryService' 29 | } 30 | $service = New-GoogleService @serviceParams 31 | } 32 | Process { 33 | try { 34 | Write-Verbose "Adding Domain '$DomainName'" 35 | $body = New-Object 'Google.Apis.Admin.Directory.directory_v1.Data.Domains' -Property @{ 36 | DomainName = $DomainName 37 | } 38 | $request = $service.Domains.Insert($body,$Script:PSGSuite.CustomerId) 39 | $request.Execute() 40 | } 41 | catch { 42 | if ($ErrorActionPreference -eq 'Stop') { 43 | $PSCmdlet.ThrowTerminatingError($_) 44 | } 45 | else { 46 | Write-Error $_ 47 | } 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /docs/pages/function_help/Classroom/Get-GSCourseAlias.md: -------------------------------------------------------------------------------- 1 | # Get-GSCourseAlias 2 | 3 | ## SYNOPSIS 4 | Gets the list of aliases for a course. 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | Get-GSCourseAlias [-CourseId] [-User ] [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Gets the list of aliases for a course. 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | Get-GSCourseAlias -CourseId 'architecture-101' 20 | ``` 21 | 22 | ## PARAMETERS 23 | 24 | ### -CourseId 25 | Identifier of the course to alias. 26 | This identifier can be either the Classroom-assigned identifier or an alias. 27 | 28 | ```yaml 29 | Type: String 30 | Parameter Sets: (All) 31 | Aliases: 32 | 33 | Required: True 34 | Position: 1 35 | Default value: None 36 | Accept pipeline input: False 37 | Accept wildcard characters: False 38 | ``` 39 | 40 | ### -User 41 | The user to authenticate the request as 42 | 43 | ```yaml 44 | Type: String 45 | Parameter Sets: (All) 46 | Aliases: 47 | 48 | Required: False 49 | Position: Named 50 | Default value: $Script:PSGSuite.AdminEmail 51 | Accept pipeline input: False 52 | Accept wildcard characters: False 53 | ``` 54 | 55 | ### CommonParameters 56 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 57 | 58 | ## INPUTS 59 | 60 | ## OUTPUTS 61 | 62 | ### Google.Apis.Classroom.v1.Data.CourseAlias 63 | ## NOTES 64 | 65 | ## RELATED LINKS 66 | -------------------------------------------------------------------------------- /docs/pages/function_help/Licensing/Set-GSUserLicense.md: -------------------------------------------------------------------------------- 1 | # Set-GSUserLicense 2 | 3 | ## SYNOPSIS 4 | Sets the license for a user 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | Set-GSUserLicense [-User] [-License] [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Sets the license for a user 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | Set-GSUserLicense -User joe -License Google-Apps-For-Business 20 | ``` 21 | 22 | Sets Joe to a Google-Apps-For-Business license 23 | 24 | ## PARAMETERS 25 | 26 | ### -License 27 | The license SKU to set for the user 28 | 29 | ```yaml 30 | Type: String 31 | Parameter Sets: (All) 32 | Aliases: SkuId 33 | 34 | Required: True 35 | Position: 2 36 | Default value: None 37 | Accept pipeline input: False 38 | Accept wildcard characters: False 39 | ``` 40 | 41 | ### -User 42 | The user's current primary email address 43 | 44 | ```yaml 45 | Type: String[] 46 | Parameter Sets: (All) 47 | Aliases: PrimaryEmail, UserKey, Mail 48 | 49 | Required: True 50 | Position: 1 51 | Default value: None 52 | Accept pipeline input: True (ByPropertyName, ByValue) 53 | Accept wildcard characters: False 54 | ``` 55 | 56 | ### CommonParameters 57 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 58 | 59 | ## INPUTS 60 | 61 | ## OUTPUTS 62 | 63 | ### Google.Apis.Licensing.v1.Data.LicenseAssignment 64 | ## NOTES 65 | 66 | ## RELATED LINKS 67 | -------------------------------------------------------------------------------- /docs/pages/function_help/URL Shortener/New-GSShortUrl.md: -------------------------------------------------------------------------------- 1 | # New-GSShortUrl 2 | 3 | ## SYNOPSIS 4 | Creates a new Short Url 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | New-GSShortUrl -LongUrl [[-User] ] [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Creates a new Short Url 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | New-GSShortUrl "http://ferrell.io" 20 | ``` 21 | 22 | Creates a new Short Url pointing at http://ferrell.io/ 23 | 24 | ## PARAMETERS 25 | 26 | ### -LongUrl 27 | The full Url to shorten 28 | 29 | ```yaml 30 | Type: String[] 31 | Parameter Sets: (All) 32 | Aliases: 33 | 34 | Required: True 35 | Position: Named 36 | Default value: None 37 | Accept pipeline input: False 38 | Accept wildcard characters: False 39 | ``` 40 | 41 | ### -User 42 | The user to create the Short Url for 43 | 44 | Defaults to the AdminEmail user 45 | 46 | ```yaml 47 | Type: String 48 | Parameter Sets: (All) 49 | Aliases: PrimaryEmail, UserKey, Mail 50 | 51 | Required: False 52 | Position: 1 53 | Default value: $Script:PSGSuite.AdminEmail 54 | Accept pipeline input: True (ByPropertyName, ByValue) 55 | Accept wildcard characters: False 56 | ``` 57 | 58 | ### CommonParameters 59 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 60 | 61 | ## INPUTS 62 | 63 | ## OUTPUTS 64 | 65 | ### Google.Apis.Urlshortener.v1.Data.Url 66 | ## NOTES 67 | 68 | ## RELATED LINKS 69 | -------------------------------------------------------------------------------- /docs/pages/function_help/Tasks/New-GSTasklist.md: -------------------------------------------------------------------------------- 1 | # New-GSTasklist 2 | 3 | ## SYNOPSIS 4 | Creates a new Tasklist 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | New-GSTasklist [-Title] [[-User] ] [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Creates a new Tasklist 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | New-GSTasklist -Title 'Chores','Projects' 20 | ``` 21 | 22 | Creates 2 new Tasklists titled 'Chores' and 'Projects' for the AdminEmail user 23 | 24 | ## PARAMETERS 25 | 26 | ### -Title 27 | The title of the new Tasklist 28 | 29 | ```yaml 30 | Type: String[] 31 | Parameter Sets: (All) 32 | Aliases: 33 | 34 | Required: True 35 | Position: 1 36 | Default value: None 37 | Accept pipeline input: False 38 | Accept wildcard characters: False 39 | ``` 40 | 41 | ### -User 42 | The User to create the Tasklist for. 43 | 44 | Defaults to the AdminUser's email. 45 | 46 | ```yaml 47 | Type: String 48 | Parameter Sets: (All) 49 | Aliases: PrimaryEmail, UserKey, Mail, Email 50 | 51 | Required: False 52 | Position: 2 53 | Default value: $Script:PSGSuite.AdminEmail 54 | Accept pipeline input: True (ByPropertyName) 55 | Accept wildcard characters: False 56 | ``` 57 | 58 | ### CommonParameters 59 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 60 | 61 | ## INPUTS 62 | 63 | ## OUTPUTS 64 | 65 | ### Google.Apis.Tasks.v1.Data.TaskList 66 | ## NOTES 67 | 68 | ## RELATED LINKS 69 | -------------------------------------------------------------------------------- /docs/pages/function_help/Groups/New-GSGroupAlias.md: -------------------------------------------------------------------------------- 1 | # New-GSGroupAlias 2 | 3 | ## SYNOPSIS 4 | Creates a new alias for a G Suite group 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | New-GSGroupAlias [-Group] [-Alias] [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Creates a new alias for a G Suite group 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | New-GSGroupAlias -Group humanresources@domain.com -Alias 'hr@domain.com','hrhelp@domain.com' 20 | ``` 21 | 22 | Creates 2 new aliases for group Human Resources as 'hr@domain.com' and 'hrhelp@domain.com' 23 | 24 | ## PARAMETERS 25 | 26 | ### -Alias 27 | The alias or list of aliases to create for the group 28 | 29 | ```yaml 30 | Type: String[] 31 | Parameter Sets: (All) 32 | Aliases: 33 | 34 | Required: True 35 | Position: 2 36 | Default value: None 37 | Accept pipeline input: False 38 | Accept wildcard characters: False 39 | ``` 40 | 41 | ### -Group 42 | The group to create the alias for 43 | 44 | ```yaml 45 | Type: String 46 | Parameter Sets: (All) 47 | Aliases: Email 48 | 49 | Required: True 50 | Position: 1 51 | Default value: None 52 | Accept pipeline input: True (ByPropertyName, ByValue) 53 | Accept wildcard characters: False 54 | ``` 55 | 56 | ### CommonParameters 57 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 58 | 59 | ## INPUTS 60 | 61 | ## OUTPUTS 62 | 63 | ### Google.Apis.Admin.Directory.directory_v1.Data.Alias 64 | ## NOTES 65 | 66 | ## RELATED LINKS 67 | -------------------------------------------------------------------------------- /docs/pages/function_help/Users/New-GSUserAlias.md: -------------------------------------------------------------------------------- 1 | # New-GSUserAlias 2 | 3 | ## SYNOPSIS 4 | Creates a new alias for a G Suite user 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | New-GSUserAlias [-User] [-Alias] [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Creates a new alias for a G Suite user 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | New-GSUserAlias -User john.smith@domain.com -Alias 'jsmith@domain.com','johns@domain.com' 20 | ``` 21 | 22 | Creates 2 new aliases for user John Smith as 'jsmith@domain.com' and 'johns@domain.com' 23 | 24 | ## PARAMETERS 25 | 26 | ### -Alias 27 | The alias or list of aliases to create for the user 28 | 29 | ```yaml 30 | Type: String[] 31 | Parameter Sets: (All) 32 | Aliases: 33 | 34 | Required: True 35 | Position: 2 36 | Default value: None 37 | Accept pipeline input: False 38 | Accept wildcard characters: False 39 | ``` 40 | 41 | ### -User 42 | The user to create the alias for 43 | 44 | ```yaml 45 | Type: String 46 | Parameter Sets: (All) 47 | Aliases: PrimaryEmail, UserKey, Mail, Email 48 | 49 | Required: True 50 | Position: 1 51 | Default value: None 52 | Accept pipeline input: True (ByPropertyName) 53 | Accept wildcard characters: False 54 | ``` 55 | 56 | ### CommonParameters 57 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 58 | 59 | ## INPUTS 60 | 61 | ## OUTPUTS 62 | 63 | ### Google.Apis.Admin.Directory.directory_v1.Data.Alias 64 | ## NOTES 65 | 66 | ## RELATED LINKS 67 | -------------------------------------------------------------------------------- /docs/pages/function_help/Gmail/Restore-GSGmailMessage.md: -------------------------------------------------------------------------------- 1 | # Restore-GSGmailMessage 2 | 3 | ## SYNOPSIS 4 | Restores a trashed message to the inbox 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | Restore-GSGmailMessage [[-User] ] [-Id] [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Restores a trashed message to the inbox 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | Restore-GSGmailMessage -User joe -Id 161622d7b76b7e1e,1616227c34d435f2 20 | ``` 21 | 22 | Restores the 2 message Id's from Joe's TRASH back to their inbox 23 | 24 | ## PARAMETERS 25 | 26 | ### -Id 27 | The Id of the message to restore 28 | 29 | ```yaml 30 | Type: String[] 31 | Parameter Sets: (All) 32 | Aliases: MessageID 33 | 34 | Required: True 35 | Position: 2 36 | Default value: None 37 | Accept pipeline input: True (ByPropertyName) 38 | Accept wildcard characters: False 39 | ``` 40 | 41 | ### -User 42 | The primary email of the user to restore the message for 43 | 44 | Defaults to the AdminEmail user 45 | 46 | ```yaml 47 | Type: String 48 | Parameter Sets: (All) 49 | Aliases: PrimaryEmail, UserKey, Mail 50 | 51 | Required: False 52 | Position: 1 53 | Default value: $Script:PSGSuite.AdminEmail 54 | Accept pipeline input: True (ByPropertyName) 55 | Accept wildcard characters: False 56 | ``` 57 | 58 | ### CommonParameters 59 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 60 | 61 | ## INPUTS 62 | 63 | ## OUTPUTS 64 | 65 | ## NOTES 66 | 67 | ## RELATED LINKS 68 | -------------------------------------------------------------------------------- /docs/pages/function_help/Domains/New-GSDomainAlias.md: -------------------------------------------------------------------------------- 1 | # New-GSDomainAlias 2 | 3 | ## SYNOPSIS 4 | Adds a new Domain Alias 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | New-GSDomainAlias [-DomainAliasName] [-ParentDomainName] [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Adds a new Domain Alias 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | New-GSDDomainAlias -DomainAliasName 'testingalias.com' -ParentDomainName 'testing.com' 20 | ``` 21 | 22 | Adds a new domain alias named 'testingalias.com' to parent domain 'testing.com' 23 | 24 | ## PARAMETERS 25 | 26 | ### -DomainAliasName 27 | Name of the domain alias to add. 28 | 29 | ```yaml 30 | Type: String 31 | Parameter Sets: (All) 32 | Aliases: DomainAlias 33 | 34 | Required: True 35 | Position: 1 36 | Default value: None 37 | Accept pipeline input: True (ByPropertyName, ByValue) 38 | Accept wildcard characters: False 39 | ``` 40 | 41 | ### -ParentDomainName 42 | Name of the parent domain to add the alias for. 43 | 44 | ```yaml 45 | Type: String 46 | Parameter Sets: (All) 47 | Aliases: 48 | 49 | Required: True 50 | Position: 2 51 | Default value: None 52 | Accept pipeline input: True (ByPropertyName, ByValue) 53 | Accept wildcard characters: False 54 | ``` 55 | 56 | ### CommonParameters 57 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 58 | 59 | ## INPUTS 60 | 61 | ## OUTPUTS 62 | 63 | ### Google.Apis.Admin.Directory.directory_v1.Data.DomainAlias 64 | ## NOTES 65 | 66 | ## RELATED LINKS 67 | -------------------------------------------------------------------------------- /docs/pages/function_help/Gmail/Get-GSGmailLabel.md: -------------------------------------------------------------------------------- 1 | # Get-GSGmailLabel 2 | 3 | ## SYNOPSIS 4 | Gets Gmail label information for the user 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | Get-GSGmailLabel [-LabelId ] [[-User] ] [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Gets Gmail label information for the user 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | Get-GSGmailLabel 20 | ``` 21 | 22 | Gets the Gmail labels of the AdminEmail user 23 | 24 | ## PARAMETERS 25 | 26 | ### -LabelId 27 | The unique Id of the label to get information for. 28 | If excluded, returns the list of labels for the user 29 | 30 | ```yaml 31 | Type: String[] 32 | Parameter Sets: (All) 33 | Aliases: Id 34 | 35 | Required: False 36 | Position: Named 37 | Default value: None 38 | Accept pipeline input: True (ByPropertyName) 39 | Accept wildcard characters: False 40 | ``` 41 | 42 | ### -User 43 | The user to get label information for 44 | 45 | Defaults to the AdminEmail user 46 | 47 | ```yaml 48 | Type: String 49 | Parameter Sets: (All) 50 | Aliases: PrimaryEmail, UserKey, Mail 51 | 52 | Required: False 53 | Position: 1 54 | Default value: $Script:PSGSuite.AdminEmail 55 | Accept pipeline input: True (ByPropertyName) 56 | Accept wildcard characters: False 57 | ``` 58 | 59 | ### CommonParameters 60 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 61 | 62 | ## INPUTS 63 | 64 | ## OUTPUTS 65 | 66 | ### Google.Apis.Gmail.v1.Data.Label 67 | ## NOTES 68 | 69 | ## RELATED LINKS 70 | -------------------------------------------------------------------------------- /PSGSuite/Private/ListPrivate/Get-GSUserASPListPrivate.ps1: -------------------------------------------------------------------------------- 1 | function Get-GSUserASPListPrivate { 2 | [cmdletbinding()] 3 | Param 4 | ( 5 | [parameter(Mandatory = $false,Position = 0,ValueFromPipeline = $true,ValueFromPipelineByPropertyName = $true)] 6 | [Alias("PrimaryEmail","UserKey","Mail")] 7 | [ValidateNotNullOrEmpty()] 8 | [String[]] 9 | $User = $Script:PSGSuite.AdminEmail 10 | ) 11 | Begin { 12 | $serviceParams = @{ 13 | Scope = 'https://www.googleapis.com/auth/admin.directory.user.security' 14 | ServiceType = 'Google.Apis.Admin.Directory.directory_v1.DirectoryService' 15 | } 16 | $service = New-GoogleService @serviceParams 17 | } 18 | Process { 19 | foreach ($U in $User) { 20 | try { 21 | if ($U -ceq 'me') { 22 | $U = $Script:PSGSuite.AdminEmail 23 | } 24 | elseif ($U -notlike "*@*.*") { 25 | $U = "$($U)@$($Script:PSGSuite.Domain)" 26 | } 27 | Write-Verbose "Getting ASP list for User '$U'" 28 | $request = $service.Asps.List($U) 29 | $result = $request.Execute() 30 | if ($null -ne $result.Items) { 31 | $result.Items | Add-Member -MemberType NoteProperty -Name 'User' -Value $U -PassThru 32 | } 33 | } 34 | catch { 35 | if ($ErrorActionPreference -eq 'Stop') { 36 | $PSCmdlet.ThrowTerminatingError($_) 37 | } 38 | else { 39 | Write-Error $_ 40 | } 41 | } 42 | } 43 | } 44 | } -------------------------------------------------------------------------------- /docs/pages/function_help/Drive/Hide-GSDrive.md: -------------------------------------------------------------------------------- 1 | # Hide-GSDrive 2 | 3 | ## SYNOPSIS 4 | Hides a Shared Drive from the default view 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | Hide-GSDrive -DriveId [[-User] ] [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Hides a Shared Drive from the default view 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | Hide-GSDrive -DriveId $driveIds 20 | ``` 21 | 22 | Hides the specified DriveIds for the AdminEmail user 23 | 24 | ## PARAMETERS 25 | 26 | ### -DriveId 27 | The unique Id of the Shared Drive to hide 28 | 29 | ```yaml 30 | Type: String[] 31 | Parameter Sets: (All) 32 | Aliases: Id, TeamDriveId 33 | 34 | Required: True 35 | Position: Named 36 | Default value: None 37 | Accept pipeline input: True (ByPropertyName) 38 | Accept wildcard characters: False 39 | ``` 40 | 41 | ### -User 42 | The email or unique Id of the user who you'd like to hide the Shared Drive for. 43 | 44 | Defaults to the AdminEmail user. 45 | 46 | ```yaml 47 | Type: String 48 | Parameter Sets: (All) 49 | Aliases: Owner, PrimaryEmail, UserKey, Mail 50 | 51 | Required: False 52 | Position: 1 53 | Default value: $Script:PSGSuite.AdminEmail 54 | Accept pipeline input: True (ByPropertyName) 55 | Accept wildcard characters: False 56 | ``` 57 | 58 | ### CommonParameters 59 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 60 | 61 | ## INPUTS 62 | 63 | ## OUTPUTS 64 | 65 | ### Google.Apis.Drive.v3.Data.Drive 66 | ## NOTES 67 | 68 | ## RELATED LINKS 69 | -------------------------------------------------------------------------------- /PSGSuite/Private/ListPrivate/Get-GSUserTokenListPrivate.ps1: -------------------------------------------------------------------------------- 1 | function Get-GSUserTokenListPrivate { 2 | [cmdletbinding()] 3 | Param 4 | ( 5 | [parameter(Mandatory = $false,Position = 0,ValueFromPipeline = $true,ValueFromPipelineByPropertyName = $true)] 6 | [Alias("PrimaryEmail","UserKey","Mail")] 7 | [ValidateNotNullOrEmpty()] 8 | [String[]] 9 | $User = $Script:PSGSuite.AdminEmail 10 | ) 11 | Begin { 12 | $serviceParams = @{ 13 | Scope = 'https://www.googleapis.com/auth/admin.directory.user.security' 14 | ServiceType = 'Google.Apis.Admin.Directory.directory_v1.DirectoryService' 15 | } 16 | $service = New-GoogleService @serviceParams 17 | } 18 | Process { 19 | foreach ($U in $User) { 20 | try { 21 | if ($U -ceq 'me') { 22 | $U = $Script:PSGSuite.AdminEmail 23 | } 24 | elseif ($U -notlike "*@*.*") { 25 | $U = "$($U)@$($Script:PSGSuite.Domain)" 26 | } 27 | Write-Verbose "Getting Token list for User '$U'" 28 | $request = $service.Tokens.List($U) 29 | $result = $request.Execute() 30 | if ($null -ne $result.Items) { 31 | $result.Items | Add-Member -MemberType NoteProperty -Name 'User' -Value $U -PassThru 32 | } 33 | } 34 | catch { 35 | if ($ErrorActionPreference -eq 'Stop') { 36 | $PSCmdlet.ThrowTerminatingError($_) 37 | } 38 | else { 39 | Write-Error $_ 40 | } 41 | } 42 | } 43 | } 44 | } -------------------------------------------------------------------------------- /PSGSuite/Public/Domains/Remove-GSDomain.ps1: -------------------------------------------------------------------------------- 1 | function Remove-GSDomain { 2 | <# 3 | .SYNOPSIS 4 | Removes a Domain 5 | 6 | .DESCRIPTION 7 | Removes a Domain 8 | 9 | .PARAMETER DomainName 10 | Name of the domain to remove. 11 | 12 | .EXAMPLE 13 | Remove-GSDDomain 'testing.com' 14 | 15 | Removes the 'testing.com' domain from your account. 16 | #> 17 | [CmdletBinding(SupportsShouldProcess = $true,ConfirmImpact = "High")] 18 | Param( 19 | [Parameter(Position = 0,ValueFromPipeline,ValueFromPipelineByPropertyName)] 20 | [Alias('Domain')] 21 | [String[]] 22 | $DomainName 23 | ) 24 | Begin { 25 | $serviceParams = @{ 26 | Scope = 'https://www.googleapis.com/auth/admin.directory.domain' 27 | ServiceType = 'Google.Apis.Admin.Directory.directory_v1.DirectoryService' 28 | } 29 | $service = New-GoogleService @serviceParams 30 | } 31 | Process { 32 | foreach ($domain in $DomainName) { 33 | try { 34 | if ($PSCmdlet.ShouldProcess("Removing Domain '$domain'")) { 35 | Write-Verbose "Removing Domain '$domain'" 36 | $request = $service.Domains.Get($Script:PSGSuite.CustomerId,$domain) 37 | $request.Execute() 38 | Write-Verbose "Domain '$domain' removed successfully" 39 | } 40 | } 41 | catch { 42 | if ($ErrorActionPreference -eq 'Stop') { 43 | $PSCmdlet.ThrowTerminatingError($_) 44 | } 45 | else { 46 | Write-Error $_ 47 | } 48 | } 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /docs/pages/function_help/Drive/Get-GSDriveFileUploadStatus.md: -------------------------------------------------------------------------------- 1 | # Get-GSDriveFileUploadStatus 2 | 3 | ## SYNOPSIS 4 | Gets the current Drive file upload status 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | Get-GSDriveFileUploadStatus [[-Id] ] [-InProgress] [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Gets the current Drive file upload status 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | Get-GSDriveFileUploadStatus -InProgress 20 | ``` 21 | 22 | Gets the upload status for all tasks currently in progress 23 | 24 | ## PARAMETERS 25 | 26 | ### -Id 27 | The upload Id for the task you'd like to retrieve the status of 28 | 29 | ```yaml 30 | Type: Int32[] 31 | Parameter Sets: (All) 32 | Aliases: 33 | 34 | Required: False 35 | Position: 1 36 | Default value: None 37 | Accept pipeline input: True (ByPropertyName, ByValue) 38 | Accept wildcard characters: False 39 | ``` 40 | 41 | ### -InProgress 42 | If passed, only returns upload statuses that are not 'Failed' or 'Completed'. 43 | If nothing is returned when passing this parameter, all tracked uploads have stopped 44 | 45 | ```yaml 46 | Type: SwitchParameter 47 | Parameter Sets: (All) 48 | Aliases: 49 | 50 | Required: False 51 | Position: Named 52 | Default value: False 53 | Accept pipeline input: False 54 | Accept wildcard characters: False 55 | ``` 56 | 57 | ### CommonParameters 58 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 59 | 60 | ## INPUTS 61 | 62 | ## OUTPUTS 63 | 64 | ## NOTES 65 | 66 | ## RELATED LINKS 67 | -------------------------------------------------------------------------------- /docs/pages/function_help/Gmail/Get-GSGmailSendAsAlias.md: -------------------------------------------------------------------------------- 1 | # Get-GSGmailSendAsAlias 2 | 3 | ## SYNOPSIS 4 | Gets SendAs alias settings for a user. 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | Get-GSGmailSendAsAlias [[-SendAsEmail] ] [-User ] [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Gets SendAs alias settings for a user. 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | Get-GSGmailSendAsSettings -User joe@domain.com 20 | ``` 21 | 22 | Gets the list of SendAs Settings for Joe 23 | 24 | ## PARAMETERS 25 | 26 | ### -SendAsEmail 27 | The SendAs alias to be retrieved. 28 | 29 | If excluded, gets the list of SendAs aliases. 30 | 31 | ```yaml 32 | Type: String[] 33 | Parameter Sets: (All) 34 | Aliases: SendAs 35 | 36 | Required: False 37 | Position: 1 38 | Default value: None 39 | Accept pipeline input: True (ByPropertyName) 40 | Accept wildcard characters: False 41 | ``` 42 | 43 | ### -User 44 | The email of the user you are getting the information for 45 | 46 | ```yaml 47 | Type: String 48 | Parameter Sets: (All) 49 | Aliases: PrimaryEmail, UserKey, Mail 50 | 51 | Required: False 52 | Position: Named 53 | Default value: $Script:PSGSuite.AdminEmail 54 | Accept pipeline input: True (ByPropertyName) 55 | Accept wildcard characters: False 56 | ``` 57 | 58 | ### CommonParameters 59 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 60 | 61 | ## INPUTS 62 | 63 | ## OUTPUTS 64 | 65 | ### Google.Apis.Gmail.v1.Data.SendAs 66 | ## NOTES 67 | 68 | ## RELATED LINKS 69 | -------------------------------------------------------------------------------- /docs/pages/function_help/Licensing/Update-GSUserLicense.md: -------------------------------------------------------------------------------- 1 | # Update-GSUserLicense 2 | 3 | ## SYNOPSIS 4 | Reassign a user's product SKU with a different SKU in the same product 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | Update-GSUserLicense [[-User] ] [-License ] [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Reassign a user's product SKU with a different SKU in the same product 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | Update-GSUserLicense -User joe -License G-Suite-Enterprise 20 | ``` 21 | 22 | Updates Joe to a G-Suite-Enterprise license 23 | 24 | ## PARAMETERS 25 | 26 | ### -License 27 | The license SKU that you would like to reassign the user to 28 | 29 | ```yaml 30 | Type: String 31 | Parameter Sets: (All) 32 | Aliases: SkuId 33 | 34 | Required: False 35 | Position: Named 36 | Default value: None 37 | Accept pipeline input: False 38 | Accept wildcard characters: False 39 | ``` 40 | 41 | ### -User 42 | The user's current primary email address 43 | 44 | ```yaml 45 | Type: String[] 46 | Parameter Sets: (All) 47 | Aliases: PrimaryEmail, UserKey, Mail 48 | 49 | Required: False 50 | Position: 1 51 | Default value: None 52 | Accept pipeline input: True (ByPropertyName, ByValue) 53 | Accept wildcard characters: False 54 | ``` 55 | 56 | ### CommonParameters 57 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 58 | 59 | ## INPUTS 60 | 61 | ## OUTPUTS 62 | 63 | ### Google.Apis.Licensing.v1.Data.LicenseAssignment 64 | ## NOTES 65 | 66 | ## RELATED LINKS 67 | -------------------------------------------------------------------------------- /docs/pages/function_help/Authentication/Get-PSGSuiteServiceCache.md: -------------------------------------------------------------------------------- 1 | # Get-PSGSuiteServiceCache 2 | 3 | ## SYNOPSIS 4 | Returns the dictionary of cached service objects created with New-GoogleService for inspection. 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | Get-PSGSuiteServiceCache [-IncludeKeys] [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Returns the dictionary of cached service objects created with New-GoogleService for inspection. 14 | 15 | The keys in the session cache dictionary are comprised of the following values which are added to the cache whenever a new session is created: 16 | 17 | $SessionKey = @($User,$ServiceType,$(($Scope | Sort-Object) -join ";")) -join ";" 18 | 19 | ## EXAMPLES 20 | 21 | ### EXAMPLE 1 22 | ``` 23 | Get-PSGSuiteServiceCache 24 | ``` 25 | 26 | ## PARAMETERS 27 | 28 | ### -IncludeKeys 29 | If $true, returns the full service cache dictionary including keys. 30 | 31 | Defaults to $false. 32 | 33 | ```yaml 34 | Type: SwitchParameter 35 | Parameter Sets: (All) 36 | Aliases: 37 | 38 | Required: False 39 | Position: 1 40 | Default value: False 41 | Accept pipeline input: False 42 | Accept wildcard characters: False 43 | ``` 44 | 45 | ### CommonParameters 46 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 47 | 48 | ## INPUTS 49 | 50 | ## OUTPUTS 51 | 52 | ## NOTES 53 | 54 | ## RELATED LINKS 55 | 56 | [https://psgsuite.io/Function%20Help/Authentication/Get-PSGSuiteServiceCache/](https://psgsuite.io/Function%20Help/Authentication/Get-PSGSuiteServiceCache/) 57 | 58 | -------------------------------------------------------------------------------- /docs/pages/function_help/Drive/Get-GSDriveProfile.md: -------------------------------------------------------------------------------- 1 | # Get-GSDriveProfile 2 | 3 | ## SYNOPSIS 4 | Gets Drive profile for the user 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | Get-GSDriveProfile [[-User] ] [[-Fields] ] [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Gets Drive profile for the user 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | Get-GSDriveProfile 20 | ``` 21 | 22 | Gets the Drive profile of the AdminEmail user 23 | 24 | ## PARAMETERS 25 | 26 | ### -Fields 27 | The specific fields to request 28 | 29 | ```yaml 30 | Type: String[] 31 | Parameter Sets: (All) 32 | Aliases: 33 | 34 | Required: False 35 | Position: 2 36 | Default value: @('AppInstalled','ExportFormats','FolderColorPalette','ImportFormats','Kind','MaxImportSizes','MaxUploadSize','StorageQuota','TeamDriveThemes','User') 37 | Accept pipeline input: False 38 | Accept wildcard characters: False 39 | ``` 40 | 41 | ### -User 42 | The user to get profile of 43 | 44 | Defaults to the AdminEmail user 45 | 46 | ```yaml 47 | Type: String 48 | Parameter Sets: (All) 49 | Aliases: Owner, PrimaryEmail, UserKey, Mail 50 | 51 | Required: False 52 | Position: 1 53 | Default value: $Script:PSGSuite.AdminEmail 54 | Accept pipeline input: True (ByPropertyName) 55 | Accept wildcard characters: False 56 | ``` 57 | 58 | ### CommonParameters 59 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 60 | 61 | ## INPUTS 62 | 63 | ## OUTPUTS 64 | 65 | ### Google.Apis.Drive.v3.Data.About 66 | ## NOTES 67 | 68 | ## RELATED LINKS 69 | -------------------------------------------------------------------------------- /docs/pages/function_help/Drive/Show-GSDrive.md: -------------------------------------------------------------------------------- 1 | # Show-GSDrive 2 | 3 | ## SYNOPSIS 4 | Shows (unhides) a Shared Drive in the default view 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | Show-GSDrive -DriveId [[-User] ] [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Shows (unhides) a Shared Drive in the default view 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | Show-GSDrive -DriveId $driveIds 20 | ``` 21 | 22 | Unhides the specified DriveIds for the AdminEmail user 23 | 24 | ## PARAMETERS 25 | 26 | ### -DriveId 27 | The unique Id of the Shared Drive to unhide 28 | 29 | ```yaml 30 | Type: String[] 31 | Parameter Sets: (All) 32 | Aliases: Id, TeamDriveId 33 | 34 | Required: True 35 | Position: Named 36 | Default value: None 37 | Accept pipeline input: True (ByPropertyName) 38 | Accept wildcard characters: False 39 | ``` 40 | 41 | ### -User 42 | The email or unique Id of the user who you'd like to unhide the Shared Drive for. 43 | 44 | Defaults to the AdminEmail user. 45 | 46 | ```yaml 47 | Type: String 48 | Parameter Sets: (All) 49 | Aliases: Owner, PrimaryEmail, UserKey, Mail 50 | 51 | Required: False 52 | Position: 1 53 | Default value: $Script:PSGSuite.AdminEmail 54 | Accept pipeline input: True (ByPropertyName) 55 | Accept wildcard characters: False 56 | ``` 57 | 58 | ### CommonParameters 59 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 60 | 61 | ## INPUTS 62 | 63 | ## OUTPUTS 64 | 65 | ### Google.Apis.Drive.v3.Data.Drive 66 | ## NOTES 67 | 68 | ## RELATED LINKS 69 | -------------------------------------------------------------------------------- /PSGSuite/Public/Chat/Remove-GSChatMessage.ps1: -------------------------------------------------------------------------------- 1 | function Remove-GSChatMessage { 2 | <# 3 | .SYNOPSIS 4 | Removes a Chat message 5 | 6 | .DESCRIPTION 7 | Removes a Chat message 8 | 9 | .PARAMETER Name 10 | Resource name of the message to be removed, in the form "spaces/messages". 11 | 12 | Example: spaces/AAAAMpdlehY/messages/UMxbHmzDlr4.UMxbHmzDlr4 13 | 14 | .EXAMPLE 15 | Remove-GSChatMessage -Name 'spaces/AAAAMpdlehY/messages/UMxbHmzDlr4.UMxbHmzDlr4' 16 | 17 | Removes the Chat message specified after confirmation 18 | #> 19 | [cmdletbinding(SupportsShouldProcess = $true,ConfirmImpact = "High")] 20 | Param 21 | ( 22 | [parameter(Mandatory = $true,Position = 0)] 23 | [Alias('Id')] 24 | [string[]] 25 | $Name 26 | ) 27 | Begin { 28 | $serviceParams = @{ 29 | Scope = 'https://www.googleapis.com/auth/chat.bot' 30 | ServiceType = 'Google.Apis.HangoutsChat.v1.HangoutsChatService' 31 | } 32 | $service = New-GoogleService @serviceParams 33 | } 34 | Process { 35 | foreach ($msg in $Name) { 36 | try { 37 | if ($PSCmdlet.ShouldProcess("Removing Message '$msg'")) { 38 | $request = $service.Spaces.Messages.Delete($msg) 39 | $request.Execute() 40 | Write-Verbose "Successfully removed Message '$msg'" 41 | } 42 | } 43 | catch { 44 | if ($ErrorActionPreference -eq 'Stop') { 45 | $PSCmdlet.ThrowTerminatingError($_) 46 | } 47 | else { 48 | Write-Error $_ 49 | } 50 | } 51 | } 52 | } 53 | } -------------------------------------------------------------------------------- /docs/pages/function_help/Classroom/Get-GSClassroomUserProfile.md: -------------------------------------------------------------------------------- 1 | # Get-GSClassroomUserProfile 2 | 3 | ## SYNOPSIS 4 | Gets a classroom user profile 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | Get-GSClassroomUserProfile [-UserId] [-Fields ] [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Gets a classroom user profile 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | Get-GSClassroomUserProfile -UserId aristotle@athens.edu 20 | ``` 21 | 22 | ## PARAMETERS 23 | 24 | ### -Fields 25 | The specific fields to fetch 26 | 27 | ```yaml 28 | Type: String[] 29 | Parameter Sets: (All) 30 | Aliases: 31 | 32 | Required: False 33 | Position: Named 34 | Default value: * 35 | Accept pipeline input: False 36 | Accept wildcard characters: False 37 | ``` 38 | 39 | ### -UserId 40 | Identifier of the profile to return. 41 | The identifier can be one of the following: 42 | 43 | * the numeric identifier for the user 44 | * the email address of the user 45 | * the string literal "me", indicating the requesting user 46 | 47 | ```yaml 48 | Type: String[] 49 | Parameter Sets: (All) 50 | Aliases: Id, PrimaryEmail, Mail, UserKey 51 | 52 | Required: True 53 | Position: 1 54 | Default value: None 55 | Accept pipeline input: True (ByPropertyName) 56 | Accept wildcard characters: False 57 | ``` 58 | 59 | ### CommonParameters 60 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 61 | 62 | ## INPUTS 63 | 64 | ## OUTPUTS 65 | 66 | ### Google.Apis.Classroom.v1.Data.UserProfile 67 | ## NOTES 68 | 69 | ## RELATED LINKS 70 | -------------------------------------------------------------------------------- /PSGSuite/Public/Org Units/Remove-GSOrganizationalUnit.ps1: -------------------------------------------------------------------------------- 1 | function Remove-GSOrganizationalUnit { 2 | <# 3 | .SYNOPSIS 4 | Removes an OrgUnit 5 | 6 | .DESCRIPTION 7 | Removes an Organization Unit 8 | 9 | .PARAMETER OrgUnitPath 10 | The path of the OrgUnit you would like to Remove-GSOrganizationalUnit 11 | 12 | .EXAMPLE 13 | Remove-GSOrganizationalUnit -OrgUnitPath "/Testing" 14 | 15 | Removes the OrgUnit "/Testing" on confirmation 16 | #> 17 | [cmdletbinding(SupportsShouldProcess = $true,ConfirmImpact = "High")] 18 | Param 19 | ( 20 | [parameter(Mandatory = $true,Position = 0)] 21 | [String[]] 22 | $OrgUnitPath 23 | ) 24 | Begin { 25 | $serviceParams = @{ 26 | Scope = 'https://www.googleapis.com/auth/admin.directory.orgunit' 27 | ServiceType = 'Google.Apis.Admin.Directory.directory_v1.DirectoryService' 28 | } 29 | $service = New-GoogleService @serviceParams 30 | } 31 | Process { 32 | try { 33 | foreach ($O in $OrgUnitPath) { 34 | if ($PSCmdlet.ShouldProcess("Deleting OrgUnit at Path '$O'")) { 35 | Write-Verbose "Deleting OrgUnit at Path '$O'" 36 | $O = $O.TrimStart('/') 37 | $request = $service.Orgunits.Delete($Script:PSGSuite.CustomerId,([Google.Apis.Util.Repeatable[String]]::new([String[]]$O))) 38 | $request.Execute() 39 | } 40 | } 41 | } 42 | catch { 43 | if ($ErrorActionPreference -eq 'Stop') { 44 | $PSCmdlet.ThrowTerminatingError($_) 45 | } 46 | else { 47 | Write-Error $_ 48 | } 49 | } 50 | } 51 | } -------------------------------------------------------------------------------- /PSGSuite/Private/ListPrivate/Get-GSOrganizationalUnitListPrivate.ps1: -------------------------------------------------------------------------------- 1 | function Get-GSOrganizationalUnitListPrivate { 2 | [cmdletbinding()] 3 | Param 4 | ( 5 | [parameter(Mandatory = $false,Position = 0)] 6 | [Alias('OrgUnitPath','BaseOrgUnitPath')] 7 | [String] 8 | $SearchBase, 9 | [parameter(Mandatory = $false)] 10 | [Alias('Type')] 11 | [ValidateSet('Subtree','OneLevel','All','Children')] 12 | [String] 13 | $SearchScope = 'All' 14 | ) 15 | Begin { 16 | $serviceParams = @{ 17 | Scope = 'https://www.googleapis.com/auth/admin.directory.orgunit' 18 | ServiceType = 'Google.Apis.Admin.Directory.directory_v1.DirectoryService' 19 | } 20 | $service = New-GoogleService @serviceParams 21 | } 22 | Process { 23 | try { 24 | Write-Verbose "Getting all Organizational Units" 25 | $request = $service.Orgunits.List($Script:PSGSuite.CustomerId) 26 | $request.Type = switch ($SearchScope) { 27 | Subtree { 28 | 'All' 29 | } 30 | OneLevel { 31 | 'Children' 32 | } 33 | default { 34 | $SearchScope 35 | } 36 | } 37 | if ($SearchBase) { 38 | $request.OrgUnitPath = $SearchBase 39 | } 40 | $request.Execute() | Select-Object -ExpandProperty OrganizationUnits 41 | } 42 | catch { 43 | if ($ErrorActionPreference -eq 'Stop') { 44 | $PSCmdlet.ThrowTerminatingError($_) 45 | } 46 | else { 47 | Write-Error $_ 48 | } 49 | } 50 | } 51 | } -------------------------------------------------------------------------------- /PSGSuite/Public/Authentication/Get-GSToken.ps1: -------------------------------------------------------------------------------- 1 | function Get-GSToken { 2 | <# 3 | .SYNOPSIS 4 | Requests an Access Token for REST API authentication. Defaults to 3600 seconds token expiration time. 5 | 6 | .DESCRIPTION 7 | Requests an Access Token for REST API authentication. Defaults to 3600 seconds token expiration time. 8 | 9 | .PARAMETER Scopes 10 | The list of scopes to request the token for 11 | 12 | .PARAMETER AdminEmail 13 | The email address of the user to request the token for. This is typically the Admin user. 14 | 15 | .EXAMPLE 16 | $Token = Get-GSToken -Scopes 'https://www.google.com/m8/feeds' -AdminEmail $User 17 | $headers = @{ 18 | Authorization = "Bearer $($Token)" 19 | 'GData-Version' = '3.0' 20 | } 21 | 22 | .LINK 23 | https://psgsuite.io/Function%20Help/Authentication/Get-GSToken/ 24 | #> 25 | Param ( 26 | [parameter(Mandatory = $true)] 27 | [Alias('Scope')] 28 | [ValidateNotNullOrEmpty()] 29 | [string[]] 30 | $Scopes, 31 | [parameter(Mandatory = $false)] 32 | [Alias('User')] 33 | [ValidateNotNullOrEmpty()] 34 | [String] 35 | $AdminEmail = $Script:PSGSuite.AdminEmail 36 | ) 37 | try { 38 | Write-Verbose "Acquiring access token" 39 | $serviceParams = @{ 40 | Scope = $Scopes 41 | ServiceType = 'Google.Apis.Gmail.v1.GmailService' 42 | User = $AdminEmail 43 | } 44 | $service = New-GoogleService @serviceParams 45 | ($service.HttpClientInitializer.GetAccessTokenForRequestAsync()).Result 46 | } 47 | catch { 48 | Write-Verbose "Failed to acquire access token!" 49 | $PSCmdlet.ThrowTerminatingError($_) 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /PSGSuite/Public/Groups/Remove-GSGroup.ps1: -------------------------------------------------------------------------------- 1 | function Remove-GSGroup { 2 | <# 3 | .SYNOPSIS 4 | Removes a group 5 | 6 | .DESCRIPTION 7 | Removes a group 8 | 9 | .PARAMETER Identity 10 | The email or unique Id of the group to removed 11 | 12 | .EXAMPLE 13 | Remove-GSGroup 'test_group' -Confirm:$false 14 | 15 | Removes the group 'test_group@domain.com' without asking for confirmation 16 | #> 17 | [cmdletbinding(SupportsShouldProcess = $true,ConfirmImpact = "High")] 18 | Param ( 19 | [parameter(Mandatory = $true,Position = 0,ValueFromPipeline = $true,ValueFromPipelineByPropertyName = $true)] 20 | [Alias('GroupEmail','Group','Email')] 21 | [String[]] 22 | $Identity 23 | ) 24 | Begin { 25 | $serviceParams = @{ 26 | Scope = 'https://www.googleapis.com/auth/admin.directory.group' 27 | ServiceType = 'Google.Apis.Admin.Directory.directory_v1.DirectoryService' 28 | } 29 | $service = New-GoogleService @serviceParams 30 | } 31 | Process { 32 | try { 33 | foreach ($G in $Identity) { 34 | Resolve-Email ([ref]$G) -IsGroup 35 | if ($PSCmdlet.ShouldProcess("Removing group '$G'")) { 36 | Write-Verbose "Removing group '$G'" 37 | $request = $service.Groups.Delete($G) 38 | $request.Execute() 39 | Write-Verbose "Group '$G' has been successfully removed" 40 | } 41 | } 42 | } 43 | catch { 44 | if ($ErrorActionPreference -eq 'Stop') { 45 | $PSCmdlet.ThrowTerminatingError($_) 46 | } 47 | else { 48 | Write-Error $_ 49 | } 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /PSGSuite/Public/Domains/Remove-GSDomainAlias.ps1: -------------------------------------------------------------------------------- 1 | function Remove-GSDomainAlias { 2 | <# 3 | .SYNOPSIS 4 | Removes a Domain Alias 5 | 6 | .DESCRIPTION 7 | Removes a Domain Alias 8 | 9 | .PARAMETER DomainAliasName 10 | Alias of the domain to remove. 11 | 12 | .EXAMPLE 13 | Remove-GSDDomainAlias 'testingalias.com' 14 | 15 | Removes the 'testingalias.com' domain alias from your account. 16 | #> 17 | [CmdletBinding(SupportsShouldProcess = $true,ConfirmImpact = "High")] 18 | Param( 19 | [Parameter(Position = 0,ValueFromPipeline,ValueFromPipelineByPropertyName)] 20 | [Alias('DomainAlias')] 21 | [String[]] 22 | $DomainAliasName 23 | ) 24 | Begin { 25 | $serviceParams = @{ 26 | Scope = 'https://www.googleapis.com/auth/admin.directory.domain' 27 | ServiceType = 'Google.Apis.Admin.Directory.directory_v1.DirectoryService' 28 | } 29 | $service = New-GoogleService @serviceParams 30 | } 31 | Process { 32 | foreach ($alias in $DomainAliasName) { 33 | try { 34 | if ($PSCmdlet.ShouldProcess("Removing Domain Alias '$domain'")) { 35 | Write-Verbose "Removing Domain Alias '$alias'" 36 | $request = $service.DomainAliases.Delete($Script:PSGSuite.CustomerId,$alias) 37 | $request.Execute() 38 | Write-Verbose "Domain Alias '$alias' removed successfully" 39 | } 40 | } 41 | catch { 42 | if ($ErrorActionPreference -eq 'Stop') { 43 | $PSCmdlet.ThrowTerminatingError($_) 44 | } 45 | else { 46 | Write-Error $_ 47 | } 48 | } 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /docs/pages/function_help/Classroom/Confirm-GSCourseInvitation.md: -------------------------------------------------------------------------------- 1 | # Confirm-GSCourseInvitation 2 | 3 | ## SYNOPSIS 4 | Accepts an invitation, removing it and adding the invited user to the teachers or students (as appropriate) of the specified course. 5 | Only the invited user may accept an invitation. 6 | 7 | ## SYNTAX 8 | 9 | ``` 10 | Confirm-GSCourseInvitation [-Id] [-User] [] 11 | ``` 12 | 13 | ## DESCRIPTION 14 | Accepts an invitation, removing it and adding the invited user to the teachers or students (as appropriate) of the specified course. 15 | Only the invited user may accept an invitation. 16 | 17 | ## EXAMPLES 18 | 19 | ### EXAMPLE 1 20 | ``` 21 | Confirm-GSCourseInvitation -Id $inviteId -User aristotle@athens.edu 22 | ``` 23 | 24 | ## PARAMETERS 25 | 26 | ### -Id 27 | Identifier of the invitation to accept. 28 | 29 | ```yaml 30 | Type: String 31 | Parameter Sets: (All) 32 | Aliases: 33 | 34 | Required: True 35 | Position: 1 36 | Default value: None 37 | Accept pipeline input: True (ByPropertyName) 38 | Accept wildcard characters: False 39 | ``` 40 | 41 | ### -User 42 | Email or email name part of the invited user. 43 | 44 | ```yaml 45 | Type: String 46 | Parameter Sets: (All) 47 | Aliases: 48 | 49 | Required: True 50 | Position: 2 51 | Default value: None 52 | Accept pipeline input: True (ByPropertyName) 53 | Accept wildcard characters: False 54 | ``` 55 | 56 | ### CommonParameters 57 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 58 | 59 | ## INPUTS 60 | 61 | ## OUTPUTS 62 | 63 | ## NOTES 64 | 65 | ## RELATED LINKS 66 | -------------------------------------------------------------------------------- /PSGSuite/Public/Gmail/Get-GSGmailPopSettings.ps1: -------------------------------------------------------------------------------- 1 | function Get-GSGmailPopSettings { 2 | <# 3 | .SYNOPSIS 4 | Gets POP settings 5 | 6 | .DESCRIPTION 7 | Gets POP settings 8 | 9 | .PARAMETER User 10 | The user to get the POP settings for 11 | 12 | Defaults to the AdminEmail user 13 | 14 | .EXAMPLE 15 | Get-GSGmailPopSettings 16 | 17 | Gets the POP settings for the AdminEmail user 18 | #> 19 | [OutputType('Google.Apis.Gmail.v1.Data.PopSettings')] 20 | [cmdletbinding()] 21 | Param 22 | ( 23 | [parameter(Mandatory = $false,Position = 0,ValueFromPipelineByPropertyName = $true)] 24 | [Alias("PrimaryEmail","UserKey","Mail")] 25 | [ValidateNotNullOrEmpty()] 26 | [string] 27 | $User = $Script:PSGSuite.AdminEmail 28 | ) 29 | Process { 30 | if ($User -ceq 'me') { 31 | $User = $Script:PSGSuite.AdminEmail 32 | } 33 | elseif ($User -notlike "*@*.*") { 34 | $User = "$($User)@$($Script:PSGSuite.Domain)" 35 | } 36 | $serviceParams = @{ 37 | Scope = 'https://www.googleapis.com/auth/gmail.settings.basic' 38 | ServiceType = 'Google.Apis.Gmail.v1.GmailService' 39 | User = $User 40 | } 41 | $service = New-GoogleService @serviceParams 42 | try { 43 | $request = $service.Users.Settings.GetPop($User) 44 | Write-Verbose "Getting POP settings for user '$User'" 45 | $request.Execute() | Add-Member -MemberType NoteProperty -Name 'User' -Value $User -PassThru 46 | } 47 | catch { 48 | if ($ErrorActionPreference -eq 'Stop') { 49 | $PSCmdlet.ThrowTerminatingError($_) 50 | } 51 | else { 52 | Write-Error $_ 53 | } 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /docs/pages/function_help/Domains/Get-GSDomainAlias.md: -------------------------------------------------------------------------------- 1 | # Get-GSDomainAlias 2 | 3 | ## SYNOPSIS 4 | Retrieves a Domain Alias 5 | 6 | ## SYNTAX 7 | 8 | ### List (Default) 9 | ``` 10 | Get-GSDomainAlias [[-ParentDomainName] ] [] 11 | ``` 12 | 13 | ### Get 14 | ``` 15 | Get-GSDomainAlias [[-DomainAliasName] ] [] 16 | ``` 17 | 18 | ## DESCRIPTION 19 | Retrieves a Domain Alias 20 | 21 | ## EXAMPLES 22 | 23 | ### EXAMPLE 1 24 | ``` 25 | Get-GSDDomainAlias 26 | ``` 27 | 28 | Returns the list of domain aliases for all domains. 29 | 30 | ## PARAMETERS 31 | 32 | ### -DomainAliasName 33 | Name of the domain alias to retrieve. 34 | 35 | If excluded, returns the list of domain aliases. 36 | 37 | ```yaml 38 | Type: String[] 39 | Parameter Sets: Get 40 | Aliases: DomainAlias 41 | 42 | Required: False 43 | Position: 1 44 | Default value: None 45 | Accept pipeline input: True (ByPropertyName, ByValue) 46 | Accept wildcard characters: False 47 | ``` 48 | 49 | ### -ParentDomainName 50 | Name of the parent domain to list aliases for. 51 | 52 | If excluded, lists all aliases for all domains. 53 | 54 | ```yaml 55 | Type: String[] 56 | Parameter Sets: List 57 | Aliases: 58 | 59 | Required: False 60 | Position: 1 61 | Default value: None 62 | Accept pipeline input: True (ByPropertyName, ByValue) 63 | Accept wildcard characters: False 64 | ``` 65 | 66 | ### CommonParameters 67 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 68 | 69 | ## INPUTS 70 | 71 | ## OUTPUTS 72 | 73 | ### Google.Apis.Admin.Directory.directory_v1.Data.DomainAlias 74 | ## NOTES 75 | 76 | ## RELATED LINKS 77 | -------------------------------------------------------------------------------- /docs/pages/function_help/Domains/Remove-GSDomain.md: -------------------------------------------------------------------------------- 1 | # Remove-GSDomain 2 | 3 | ## SYNOPSIS 4 | Removes a Domain 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | Remove-GSDomain [[-DomainName] ] [-WhatIf] [-Confirm] [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Removes a Domain 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | Remove-GSDDomain 'testing.com' 20 | ``` 21 | 22 | Removes the 'testing.com' domain from your account. 23 | 24 | ## PARAMETERS 25 | 26 | ### -DomainName 27 | Name of the domain to remove. 28 | 29 | ```yaml 30 | Type: String[] 31 | Parameter Sets: (All) 32 | Aliases: Domain 33 | 34 | Required: False 35 | Position: 1 36 | Default value: None 37 | Accept pipeline input: True (ByPropertyName, ByValue) 38 | Accept wildcard characters: False 39 | ``` 40 | 41 | ### -Confirm 42 | Prompts you for confirmation before running the cmdlet. 43 | 44 | ```yaml 45 | Type: SwitchParameter 46 | Parameter Sets: (All) 47 | Aliases: cf 48 | 49 | Required: False 50 | Position: Named 51 | Default value: None 52 | Accept pipeline input: False 53 | Accept wildcard characters: False 54 | ``` 55 | 56 | ### -WhatIf 57 | Shows what would happen if the cmdlet runs. 58 | The cmdlet is not run. 59 | 60 | ```yaml 61 | Type: SwitchParameter 62 | Parameter Sets: (All) 63 | Aliases: wi 64 | 65 | Required: False 66 | Position: Named 67 | Default value: None 68 | Accept pipeline input: False 69 | Accept wildcard characters: False 70 | ``` 71 | 72 | ### CommonParameters 73 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 74 | 75 | ## INPUTS 76 | 77 | ## OUTPUTS 78 | 79 | ## NOTES 80 | 81 | ## RELATED LINKS 82 | -------------------------------------------------------------------------------- /PSGSuite/Private/ListPrivate/Get-GSShortUrlListPrivate.ps1: -------------------------------------------------------------------------------- 1 | function Get-GSShortUrlListPrivate { 2 | [cmdletbinding()] 3 | Param ( 4 | [parameter(Mandatory = $false,Position = 0,ValueFromPipeline = $true,ValueFromPipelineByPropertyName = $true)] 5 | [Alias("PrimaryEmail","UserKey","Mail","Email")] 6 | [ValidateNotNullOrEmpty()] 7 | [String[]] 8 | $User = $Script:PSGSuite.AdminEmail, 9 | [parameter(Mandatory=$false)] 10 | [ValidateSet("Full","Analytics_Clicks")] 11 | [string] 12 | $Projection = "Full" 13 | ) 14 | Process { 15 | foreach ($U in $User) { 16 | if ($U -ceq 'me') { 17 | $U = $Script:PSGSuite.AdminEmail 18 | } 19 | elseif ($U -notlike "*@*.*") { 20 | $U = "$($U)@$($Script:PSGSuite.Domain)" 21 | } 22 | $serviceParams = @{ 23 | Scope = 'https://www.googleapis.com/auth/urlshortener' 24 | ServiceType = 'Google.Apis.Urlshortener.v1.UrlshortenerService' 25 | User = "$U" 26 | } 27 | $service = New-GoogleService @serviceParams 28 | try { 29 | Write-Verbose "Getting Short Url list for User '$U'" 30 | $request = $service.Url.List() 31 | $result = $request.Execute() 32 | if ($null -ne $result.Items) { 33 | $result.Items | Add-Member -MemberType NoteProperty -Name 'User' -Value $U -PassThru 34 | } 35 | } 36 | catch { 37 | if ($ErrorActionPreference -eq 'Stop') { 38 | $PSCmdlet.ThrowTerminatingError($_) 39 | } 40 | else { 41 | Write-Error $_ 42 | } 43 | } 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /PSGSuite/Public/Gmail/Get-GSGmailImapSettings.ps1: -------------------------------------------------------------------------------- 1 | function Get-GSGmailImapSettings { 2 | <# 3 | .SYNOPSIS 4 | Gets IMAP settings 5 | 6 | .DESCRIPTION 7 | Gets IMAP settings 8 | 9 | .PARAMETER User 10 | The user to get the IMAP settings for 11 | 12 | Defaults to the AdminEmail user 13 | 14 | .EXAMPLE 15 | Get-GSGmailImapSettings 16 | 17 | Gets the IMAP settings for the AdminEmail user 18 | #> 19 | [OutputType('Google.Apis.Gmail.v1.Data.ImapSettings')] 20 | [cmdletbinding()] 21 | Param 22 | ( 23 | [parameter(Mandatory = $false,Position = 0,ValueFromPipelineByPropertyName = $true)] 24 | [Alias("PrimaryEmail","UserKey","Mail")] 25 | [ValidateNotNullOrEmpty()] 26 | [string] 27 | $User = $Script:PSGSuite.AdminEmail 28 | ) 29 | Process { 30 | if ($User -ceq 'me') { 31 | $User = $Script:PSGSuite.AdminEmail 32 | } 33 | elseif ($User -notlike "*@*.*") { 34 | $User = "$($User)@$($Script:PSGSuite.Domain)" 35 | } 36 | $serviceParams = @{ 37 | Scope = 'https://www.googleapis.com/auth/gmail.settings.basic' 38 | ServiceType = 'Google.Apis.Gmail.v1.GmailService' 39 | User = $User 40 | } 41 | $service = New-GoogleService @serviceParams 42 | try { 43 | $request = $service.Users.Settings.GetImap($User) 44 | Write-Verbose "Getting IMAP settings for user '$User'" 45 | $request.Execute() | Add-Member -MemberType NoteProperty -Name 'User' -Value $User -PassThru 46 | } 47 | catch { 48 | if ($ErrorActionPreference -eq 'Stop') { 49 | $PSCmdlet.ThrowTerminatingError($_) 50 | } 51 | else { 52 | Write-Error $_ 53 | } 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /docs/pages/function_help/Users/Update-GSUserPhoto.md: -------------------------------------------------------------------------------- 1 | # Update-GSUserPhoto 2 | 3 | ## SYNOPSIS 4 | Updates the photo for the specified user 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | Update-GSUserPhoto [-User] [-Path] [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Updates the photo for the specified user 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | Update-GSUserPhoto -User me -Path .\myphoto.png 20 | ``` 21 | 22 | Updates the Google user photo of the AdminEmail with the image at the specified path 23 | 24 | ## PARAMETERS 25 | 26 | ### -Path 27 | The path of the photo that you would like to update the user with. 28 | 29 | ```yaml 30 | Type: String 31 | Parameter Sets: (All) 32 | Aliases: 33 | 34 | Required: True 35 | Position: 2 36 | Default value: None 37 | Accept pipeline input: False 38 | Accept wildcard characters: False 39 | ``` 40 | 41 | ### -User 42 | The primary email or UserID of the user who you are trying to update the photo for. 43 | You can exclude the '@domain.com' to insert the Domain in the config or use the special 'me' to indicate the AdminEmail in the config. 44 | 45 | ```yaml 46 | Type: String 47 | Parameter Sets: (All) 48 | Aliases: PrimaryEmail, UserKey, Mail 49 | 50 | Required: True 51 | Position: 1 52 | Default value: None 53 | Accept pipeline input: True (ByPropertyName, ByValue) 54 | Accept wildcard characters: False 55 | ``` 56 | 57 | ### CommonParameters 58 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 59 | 60 | ## INPUTS 61 | 62 | ## OUTPUTS 63 | 64 | ### Google.Apis.Admin.Directory.directory_v1.Data.UserPhoto 65 | ## NOTES 66 | 67 | ## RELATED LINKS 68 | -------------------------------------------------------------------------------- /docs/pages/function_help/Groups/Test-GSGroupMembership.md: -------------------------------------------------------------------------------- 1 | # Test-GSGroupMembership 2 | 3 | ## SYNOPSIS 4 | Checks if a Group has a specific member 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | Test-GSGroupMembership [-Identity] [-Member] [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Checks if a Group has a specific member 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | Test-GSGroupMembership -Identity admins@domain.com -Member john@domain.com 20 | ``` 21 | 22 | Tests if john@domain.com is a member of admins@domain.com 23 | 24 | ## PARAMETERS 25 | 26 | ### -Identity 27 | The email of the group 28 | 29 | If only the email name-part is passed, the full email will be contstructed using the Domain from the active config 30 | 31 | ```yaml 32 | Type: String 33 | Parameter Sets: (All) 34 | Aliases: GroupEmail, Group, Email 35 | 36 | Required: True 37 | Position: 1 38 | Default value: None 39 | Accept pipeline input: True (ByPropertyName, ByValue) 40 | Accept wildcard characters: False 41 | ``` 42 | 43 | ### -Member 44 | The user to confirm as a member of the Group 45 | 46 | ```yaml 47 | Type: String[] 48 | Parameter Sets: (All) 49 | Aliases: PrimaryEmail, UserKey, Mail, User, UserEmail, Members 50 | 51 | Required: True 52 | Position: 2 53 | Default value: None 54 | Accept pipeline input: True (ByPropertyName) 55 | Accept wildcard characters: False 56 | ``` 57 | 58 | ### CommonParameters 59 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 60 | 61 | ## INPUTS 62 | 63 | ## OUTPUTS 64 | 65 | ### Google.Apis.Admin.Directory.directory_v1.Data.MembersHasMember 66 | ## NOTES 67 | 68 | ## RELATED LINKS 69 | -------------------------------------------------------------------------------- /docs/pages/function_help/Gmail/Get-GSGmailForwardingAddress.md: -------------------------------------------------------------------------------- 1 | # Get-GSGmailForwardingAddress 2 | 3 | ## SYNOPSIS 4 | Gets Gmail forwarding address information for the user 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | Get-GSGmailForwardingAddress [-ForwardingAddress ] [[-User] ] [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Gets Gmail forwarding address information for the user 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | Get-GSGmailForwardingAddress 20 | ``` 21 | 22 | Gets the list of forwarding addresses for the AdminEmail user 23 | 24 | ## PARAMETERS 25 | 26 | ### -ForwardingAddress 27 | The forwarding address you would like to get info for. 28 | If excluded, gets the list of forwarding addresses and their info for the user 29 | 30 | ```yaml 31 | Type: String[] 32 | Parameter Sets: (All) 33 | Aliases: Id 34 | 35 | Required: False 36 | Position: Named 37 | Default value: None 38 | Accept pipeline input: True (ByPropertyName) 39 | Accept wildcard characters: False 40 | ``` 41 | 42 | ### -User 43 | The user to get the forwarding addresses for 44 | 45 | Defaults to the AdminEmail user 46 | 47 | ```yaml 48 | Type: String 49 | Parameter Sets: (All) 50 | Aliases: PrimaryEmail, UserKey, Mail 51 | 52 | Required: False 53 | Position: 1 54 | Default value: $Script:PSGSuite.AdminEmail 55 | Accept pipeline input: True (ByPropertyName) 56 | Accept wildcard characters: False 57 | ``` 58 | 59 | ### CommonParameters 60 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 61 | 62 | ## INPUTS 63 | 64 | ## OUTPUTS 65 | 66 | ### Google.Apis.Gmail.v1.Data.ForwardingAddress 67 | ## NOTES 68 | 69 | ## RELATED LINKS 70 | -------------------------------------------------------------------------------- /docs/pages/function_help/Chat/Get-GSChatMember.md: -------------------------------------------------------------------------------- 1 | # Get-GSChatMember 2 | 3 | ## SYNOPSIS 4 | Gets Chat member information 5 | 6 | ## SYNTAX 7 | 8 | ### List (Default) 9 | ``` 10 | Get-GSChatMember -Space [] 11 | ``` 12 | 13 | ### Get 14 | ``` 15 | Get-GSChatMember -Member [] 16 | ``` 17 | 18 | ## DESCRIPTION 19 | Gets Chat member information 20 | 21 | ## EXAMPLES 22 | 23 | ### EXAMPLE 1 24 | ``` 25 | Get-GSChatMember -Space 'spaces/AAAAMpdlehY' 26 | ``` 27 | 28 | Gets the list of human members in the Chat space specified 29 | 30 | ## PARAMETERS 31 | 32 | ### -Member 33 | Resource name of the membership to be retrieved, in the form "spaces/members". 34 | 35 | Example: spaces/AAAAMpdlehY/members/105115627578887013105 36 | 37 | ```yaml 38 | Type: String[] 39 | Parameter Sets: Get 40 | Aliases: 41 | 42 | Required: True 43 | Position: Named 44 | Default value: None 45 | Accept pipeline input: False 46 | Accept wildcard characters: False 47 | ``` 48 | 49 | ### -Space 50 | The resource name of the space for which membership list is to be fetched, in the form "spaces". 51 | 52 | Example: spaces/AAAAMpdlehY 53 | 54 | ```yaml 55 | Type: String[] 56 | Parameter Sets: List 57 | Aliases: Parent, Name 58 | 59 | Required: True 60 | Position: Named 61 | Default value: None 62 | Accept pipeline input: True (ByPropertyName) 63 | Accept wildcard characters: False 64 | ``` 65 | 66 | ### CommonParameters 67 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 68 | 69 | ## INPUTS 70 | 71 | ## OUTPUTS 72 | 73 | ### Google.Apis.HangoutsChat.v1.Data.Membership 74 | ## NOTES 75 | 76 | ## RELATED LINKS 77 | -------------------------------------------------------------------------------- /docs/pages/function_help/Gmail/Send-GSGmailSendAsConfirmation.md: -------------------------------------------------------------------------------- 1 | # Send-GSGmailSendAsConfirmation 2 | 3 | ## SYNOPSIS 4 | Sends a verification email to the specified send-as alias address. 5 | The verification status must be pending. 6 | 7 | ## SYNTAX 8 | 9 | ``` 10 | Send-GSGmailSendAsConfirmation [-SendAsEmail] -User [] 11 | ``` 12 | 13 | ## DESCRIPTION 14 | Sends a verification email to the specified send-as alias address. 15 | The verification status must be pending. 16 | 17 | ## EXAMPLES 18 | 19 | ### EXAMPLE 1 20 | ``` 21 | Send-GSGmailSendAsConfirmation -SendAsEmail joseph.wiggum@work.com -User joe@domain.com 22 | ``` 23 | 24 | Sends a verification email to Joe's work address to confirm joe@domain.com as being able to send-as that account. 25 | 26 | ## PARAMETERS 27 | 28 | ### -SendAsEmail 29 | The SendAs alias to be verified. 30 | 31 | ```yaml 32 | Type: String[] 33 | Parameter Sets: (All) 34 | Aliases: SendAs 35 | 36 | Required: True 37 | Position: 1 38 | Default value: None 39 | Accept pipeline input: True (ByPropertyName) 40 | Accept wildcard characters: False 41 | ``` 42 | 43 | ### -User 44 | The email of the user you are verifying the SendAs alias for. 45 | 46 | ```yaml 47 | Type: String 48 | Parameter Sets: (All) 49 | Aliases: PrimaryEmail, UserKey, Mail 50 | 51 | Required: True 52 | Position: Named 53 | Default value: None 54 | Accept pipeline input: True (ByPropertyName) 55 | Accept wildcard characters: False 56 | ``` 57 | 58 | ### CommonParameters 59 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 60 | 61 | ## INPUTS 62 | 63 | ## OUTPUTS 64 | 65 | ## NOTES 66 | 67 | ## RELATED LINKS 68 | -------------------------------------------------------------------------------- /PSGSuite/Public/Classroom/Get-GSCourseAlias.ps1: -------------------------------------------------------------------------------- 1 | function Get-GSCourseAlias { 2 | <# 3 | .SYNOPSIS 4 | Gets the list of aliases for a course. 5 | 6 | .DESCRIPTION 7 | Gets the list of aliases for a course. 8 | 9 | .PARAMETER CourseId 10 | Identifier of the course to alias. This identifier can be either the Classroom-assigned identifier or an alias. 11 | 12 | .PARAMETER User 13 | The user to authenticate the request as 14 | 15 | .EXAMPLE 16 | Get-GSCourseAlias -CourseId 'architecture-101' 17 | #> 18 | [OutputType('Google.Apis.Classroom.v1.Data.CourseAlias')] 19 | [cmdletbinding()] 20 | Param 21 | ( 22 | [parameter(Mandatory = $true,Position = 0)] 23 | [String] 24 | $CourseId, 25 | [parameter(Mandatory = $false)] 26 | [String] 27 | $User = $Script:PSGSuite.AdminEmail 28 | ) 29 | Begin { 30 | if ($User -ceq 'me') { 31 | $User = $Script:PSGSuite.AdminEmail 32 | } 33 | elseif ($User -notlike "*@*.*") { 34 | $User = "$($User)@$($Script:PSGSuite.Domain)" 35 | } 36 | $serviceParams = @{ 37 | Scope = 'https://www.googleapis.com/auth/classroom.courses' 38 | ServiceType = 'Google.Apis.Classroom.v1.ClassroomService' 39 | User = $User 40 | } 41 | $service = New-GoogleService @serviceParams 42 | } 43 | Process { 44 | try { 45 | Write-Verbose "Getting Alias list for Course '$CourseId'" 46 | $request = $service.Courses.Aliases.List($CourseId) 47 | $request.Execute() 48 | } 49 | catch { 50 | if ($ErrorActionPreference -eq 'Stop') { 51 | $PSCmdlet.ThrowTerminatingError($_) 52 | } 53 | else { 54 | Write-Error $_ 55 | } 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /docs/pages/function_help/Users/Remove-GSUser.md: -------------------------------------------------------------------------------- 1 | # Remove-GSUser 2 | 3 | ## SYNOPSIS 4 | Removes a user 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | Remove-GSUser [[-User] ] [-WhatIf] [-Confirm] [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Removes a user 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | Remove-GSUser joe -Confirm:$false 20 | ``` 21 | 22 | Removes the user 'joe@domain.com', skipping confirmation 23 | 24 | ## PARAMETERS 25 | 26 | ### -User 27 | The primary email or unique Id of the user to Remove-GSUser 28 | 29 | ```yaml 30 | Type: String[] 31 | Parameter Sets: (All) 32 | Aliases: PrimaryEmail, UserKey, Mail 33 | 34 | Required: False 35 | Position: 1 36 | Default value: None 37 | Accept pipeline input: True (ByPropertyName, ByValue) 38 | Accept wildcard characters: False 39 | ``` 40 | 41 | ### -Confirm 42 | Prompts you for confirmation before running the cmdlet. 43 | 44 | ```yaml 45 | Type: SwitchParameter 46 | Parameter Sets: (All) 47 | Aliases: cf 48 | 49 | Required: False 50 | Position: Named 51 | Default value: None 52 | Accept pipeline input: False 53 | Accept wildcard characters: False 54 | ``` 55 | 56 | ### -WhatIf 57 | Shows what would happen if the cmdlet runs. 58 | The cmdlet is not run. 59 | 60 | ```yaml 61 | Type: SwitchParameter 62 | Parameter Sets: (All) 63 | Aliases: wi 64 | 65 | Required: False 66 | Position: Named 67 | Default value: None 68 | Accept pipeline input: False 69 | Accept wildcard characters: False 70 | ``` 71 | 72 | ### CommonParameters 73 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 74 | 75 | ## INPUTS 76 | 77 | ## OUTPUTS 78 | 79 | ## NOTES 80 | 81 | ## RELATED LINKS 82 | -------------------------------------------------------------------------------- /PSGSuite/Public/Gmail/Get-GSGmailVacationSettings.ps1: -------------------------------------------------------------------------------- 1 | function Get-GSGmailVacationSettings { 2 | <# 3 | .SYNOPSIS 4 | Gets Vacation settings 5 | 6 | .DESCRIPTION 7 | Gets Vacation settings 8 | 9 | .PARAMETER User 10 | The user to get the Vacation settings for 11 | 12 | Defaults to the AdminEmail user 13 | 14 | .EXAMPLE 15 | Get-GSGmailVacationSettings 16 | 17 | Gets the Vacation settings for the AdminEmail user 18 | #> 19 | [OutputType('Google.Apis.Gmail.v1.Data.VacationSettings')] 20 | [cmdletbinding()] 21 | Param 22 | ( 23 | [parameter(Mandatory = $false,Position = 0,ValueFromPipelineByPropertyName = $true)] 24 | [Alias("PrimaryEmail","UserKey","Mail")] 25 | [ValidateNotNullOrEmpty()] 26 | [string] 27 | $User = $Script:PSGSuite.AdminEmail 28 | ) 29 | Process { 30 | if ($User -ceq 'me') { 31 | $User = $Script:PSGSuite.AdminEmail 32 | } 33 | elseif ($User -notlike "*@*.*") { 34 | $User = "$($User)@$($Script:PSGSuite.Domain)" 35 | } 36 | $serviceParams = @{ 37 | Scope = 'https://www.googleapis.com/auth/gmail.settings.basic' 38 | ServiceType = 'Google.Apis.Gmail.v1.GmailService' 39 | User = $User 40 | } 41 | $service = New-GoogleService @serviceParams 42 | try { 43 | $request = $service.Users.Settings.GetVacation($User) 44 | Write-Verbose "Getting Vacation settings for user '$User'" 45 | $request.Execute() | Add-Member -MemberType NoteProperty -Name 'User' -Value $User -PassThru 46 | } 47 | catch { 48 | if ($ErrorActionPreference -eq 'Stop') { 49 | $PSCmdlet.ThrowTerminatingError($_) 50 | } 51 | else { 52 | Write-Error $_ 53 | } 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /docs/pages/function_help/Groups/Remove-GSGroup.md: -------------------------------------------------------------------------------- 1 | # Remove-GSGroup 2 | 3 | ## SYNOPSIS 4 | Removes a group 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | Remove-GSGroup [-Identity] [-WhatIf] [-Confirm] [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Removes a group 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | Remove-GSGroup 'test_group' -Confirm:$false 20 | ``` 21 | 22 | Removes the group 'test_group@domain.com' without asking for confirmation 23 | 24 | ## PARAMETERS 25 | 26 | ### -Identity 27 | The email or unique Id of the group to removed 28 | 29 | ```yaml 30 | Type: String[] 31 | Parameter Sets: (All) 32 | Aliases: GroupEmail, Group, Email 33 | 34 | Required: True 35 | Position: 1 36 | Default value: None 37 | Accept pipeline input: True (ByPropertyName, ByValue) 38 | Accept wildcard characters: False 39 | ``` 40 | 41 | ### -Confirm 42 | Prompts you for confirmation before running the cmdlet. 43 | 44 | ```yaml 45 | Type: SwitchParameter 46 | Parameter Sets: (All) 47 | Aliases: cf 48 | 49 | Required: False 50 | Position: Named 51 | Default value: None 52 | Accept pipeline input: False 53 | Accept wildcard characters: False 54 | ``` 55 | 56 | ### -WhatIf 57 | Shows what would happen if the cmdlet runs. 58 | The cmdlet is not run. 59 | 60 | ```yaml 61 | Type: SwitchParameter 62 | Parameter Sets: (All) 63 | Aliases: wi 64 | 65 | Required: False 66 | Position: Named 67 | Default value: None 68 | Accept pipeline input: False 69 | Accept wildcard characters: False 70 | ``` 71 | 72 | ### CommonParameters 73 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 74 | 75 | ## INPUTS 76 | 77 | ## OUTPUTS 78 | 79 | ## NOTES 80 | 81 | ## RELATED LINKS 82 | -------------------------------------------------------------------------------- /PSGSuite/Public/Groups/Get-GSGroupAlias.ps1: -------------------------------------------------------------------------------- 1 | function Get-GSGroupAlias { 2 | <# 3 | .SYNOPSIS 4 | Gets the specified G SUite Group's aliases 5 | 6 | .DESCRIPTION 7 | Gets the specified G SUite Group's aliases 8 | 9 | .PARAMETER Identity 10 | The primary email or ID of the group who you are trying to get aliases for. You can exclude the '@domain.com' to insert the Domain in the config or use the special 'me' to indicate the AdminEmail in the config. 11 | 12 | .EXAMPLE 13 | Get-GSGroupAlias -Identity hr 14 | 15 | Gets the list of aliases for the group hr@domain.com 16 | #> 17 | [OutputType('Google.Apis.Admin.Directory.directory_v1.Data.Alias')] 18 | [cmdletbinding()] 19 | Param 20 | ( 21 | [parameter(Mandatory = $true,Position = 0,ValueFromPipeline = $true,ValueFromPipelineByPropertyName = $true)] 22 | [Alias('GroupEmail','Group','Email')] 23 | [String[]] 24 | $Identity 25 | ) 26 | Begin { 27 | $serviceParams = @{ 28 | Scope = 'https://www.googleapis.com/auth/admin.directory.group' 29 | ServiceType = 'Google.Apis.Admin.Directory.directory_v1.DirectoryService' 30 | } 31 | $service = New-GoogleService @serviceParams 32 | } 33 | Process { 34 | foreach ($G in $Identity) { 35 | try { 36 | Resolve-Email ([ref]$G) -IsGroup 37 | Write-Verbose "Getting Alias list for Group '$G'" 38 | $request = $service.Groups.Aliases.List($G) 39 | $request.Execute() | Select-Object -ExpandProperty AliasesValue 40 | } 41 | catch { 42 | if ($ErrorActionPreference -eq 'Stop') { 43 | $PSCmdlet.ThrowTerminatingError($_) 44 | } 45 | else { 46 | Write-Error $_ 47 | } 48 | } 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /docs/pages/function_help/Domains/Remove-GSDomainAlias.md: -------------------------------------------------------------------------------- 1 | # Remove-GSDomainAlias 2 | 3 | ## SYNOPSIS 4 | Removes a Domain Alias 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | Remove-GSDomainAlias [[-DomainAliasName] ] [-WhatIf] [-Confirm] [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Removes a Domain Alias 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | Remove-GSDDomainAlias 'testingalias.com' 20 | ``` 21 | 22 | Removes the 'testingalias.com' domain alias from your account. 23 | 24 | ## PARAMETERS 25 | 26 | ### -DomainAliasName 27 | Alias of the domain to remove. 28 | 29 | ```yaml 30 | Type: String[] 31 | Parameter Sets: (All) 32 | Aliases: DomainAlias 33 | 34 | Required: False 35 | Position: 1 36 | Default value: None 37 | Accept pipeline input: True (ByPropertyName, ByValue) 38 | Accept wildcard characters: False 39 | ``` 40 | 41 | ### -Confirm 42 | Prompts you for confirmation before running the cmdlet. 43 | 44 | ```yaml 45 | Type: SwitchParameter 46 | Parameter Sets: (All) 47 | Aliases: cf 48 | 49 | Required: False 50 | Position: Named 51 | Default value: None 52 | Accept pipeline input: False 53 | Accept wildcard characters: False 54 | ``` 55 | 56 | ### -WhatIf 57 | Shows what would happen if the cmdlet runs. 58 | The cmdlet is not run. 59 | 60 | ```yaml 61 | Type: SwitchParameter 62 | Parameter Sets: (All) 63 | Aliases: wi 64 | 65 | Required: False 66 | Position: Named 67 | Default value: None 68 | Accept pipeline input: False 69 | Accept wildcard characters: False 70 | ``` 71 | 72 | ### CommonParameters 73 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 74 | 75 | ## INPUTS 76 | 77 | ## OUTPUTS 78 | 79 | ## NOTES 80 | 81 | ## RELATED LINKS 82 | -------------------------------------------------------------------------------- /PSGSuite/Public/Schemas/Get-GSUserSchema.ps1: -------------------------------------------------------------------------------- 1 | function Get-GSUserSchema { 2 | <# 3 | .SYNOPSIS 4 | Gets custom user schema info 5 | 6 | .DESCRIPTION 7 | Gets custom user schema info 8 | 9 | .PARAMETER SchemaId 10 | The Id or Name of the user schema you would like to return info for. If excluded, gets the full list of user schemas 11 | 12 | .EXAMPLE 13 | Get-GSUserSchema 14 | 15 | Gets the list of custom user schemas 16 | #> 17 | [OutputType('Google.Apis.Admin.Directory.directory_v1.Data.Schema')] 18 | [cmdletbinding()] 19 | Param 20 | ( 21 | [parameter(Mandatory = $false,Position = 0,ValueFromPipelineByPropertyName = $true)] 22 | [Alias('Schema')] 23 | [String[]] 24 | $SchemaId 25 | ) 26 | Begin { 27 | if ($PSBoundParameters.Keys -contains 'SchemaId') { 28 | $serviceParams = @{ 29 | Scope = 'https://www.googleapis.com/auth/admin.directory.userschema' 30 | ServiceType = 'Google.Apis.Admin.Directory.directory_v1.DirectoryService' 31 | } 32 | $service = New-GoogleService @serviceParams 33 | } 34 | } 35 | Process { 36 | try { 37 | if ($PSBoundParameters.Keys -contains 'SchemaId') { 38 | foreach ($S in $SchemaId) { 39 | Write-Verbose "Getting schema Id '$S'" 40 | $request = $service.Schemas.Get($Script:PSGSuite.CustomerId,$S) 41 | $request.Execute() 42 | } 43 | } 44 | else { 45 | Get-GSUserSchemaListPrivate @PSBoundParameters 46 | } 47 | } 48 | catch { 49 | if ($ErrorActionPreference -eq 'Stop') { 50 | $PSCmdlet.ThrowTerminatingError($_) 51 | } 52 | else { 53 | Write-Error $_ 54 | } 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /PSGSuite/Public/Users/Remove-GSUser.ps1: -------------------------------------------------------------------------------- 1 | function Remove-GSUser { 2 | <# 3 | .SYNOPSIS 4 | Removes a user 5 | 6 | .DESCRIPTION 7 | Removes a user 8 | 9 | .PARAMETER User 10 | The primary email or unique Id of the user to Remove-GSUser 11 | 12 | .EXAMPLE 13 | Remove-GSUser joe -Confirm:$false 14 | 15 | Removes the user 'joe@domain.com', skipping confirmation 16 | #> 17 | [cmdletbinding(SupportsShouldProcess = $true,ConfirmImpact = "High")] 18 | Param 19 | ( 20 | [parameter(Mandatory = $false,Position = 0,ValueFromPipeline = $true,ValueFromPipelineByPropertyName = $true)] 21 | [Alias("PrimaryEmail","UserKey","Mail")] 22 | [ValidateNotNullOrEmpty()] 23 | [String[]] 24 | $User 25 | ) 26 | Begin { 27 | $serviceParams = @{ 28 | Scope = 'https://www.googleapis.com/auth/admin.directory.user' 29 | ServiceType = 'Google.Apis.Admin.Directory.directory_v1.DirectoryService' 30 | } 31 | $service = New-GoogleService @serviceParams 32 | } 33 | Process { 34 | foreach ($U in $User) { 35 | try { 36 | if ($U -notlike "*@*.*") { 37 | $U = "$($U)@$($Script:PSGSuite.Domain)" 38 | } 39 | if ($PSCmdlet.ShouldProcess("Deleting user '$U'")) { 40 | Write-Verbose "Deleting user '$U'" 41 | $request = $service.Users.Delete($U) 42 | $request.Execute() 43 | Write-Verbose "User '$U' has been successfully deleted" 44 | } 45 | } 46 | catch { 47 | if ($ErrorActionPreference -eq 'Stop') { 48 | $PSCmdlet.ThrowTerminatingError($_) 49 | } 50 | else { 51 | Write-Error $_ 52 | } 53 | } 54 | } 55 | } 56 | } -------------------------------------------------------------------------------- /docs/pages/function_help/Org Units/Remove-GSOrganizationalUnit.md: -------------------------------------------------------------------------------- 1 | # Remove-GSOrganizationalUnit 2 | 3 | ## SYNOPSIS 4 | Removes an OrgUnit 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | Remove-GSOrganizationalUnit [-OrgUnitPath] [-WhatIf] [-Confirm] [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Removes an Organization Unit 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | Remove-GSOrganizationalUnit -OrgUnitPath "/Testing" 20 | ``` 21 | 22 | Removes the OrgUnit "/Testing" on confirmation 23 | 24 | ## PARAMETERS 25 | 26 | ### -OrgUnitPath 27 | The path of the OrgUnit you would like to Remove-GSOrganizationalUnit 28 | 29 | ```yaml 30 | Type: String[] 31 | Parameter Sets: (All) 32 | Aliases: 33 | 34 | Required: True 35 | Position: 1 36 | Default value: None 37 | Accept pipeline input: False 38 | Accept wildcard characters: False 39 | ``` 40 | 41 | ### -Confirm 42 | Prompts you for confirmation before running the cmdlet. 43 | 44 | ```yaml 45 | Type: SwitchParameter 46 | Parameter Sets: (All) 47 | Aliases: cf 48 | 49 | Required: False 50 | Position: Named 51 | Default value: None 52 | Accept pipeline input: False 53 | Accept wildcard characters: False 54 | ``` 55 | 56 | ### -WhatIf 57 | Shows what would happen if the cmdlet runs. 58 | The cmdlet is not run. 59 | 60 | ```yaml 61 | Type: SwitchParameter 62 | Parameter Sets: (All) 63 | Aliases: wi 64 | 65 | Required: False 66 | Position: Named 67 | Default value: None 68 | Accept pipeline input: False 69 | Accept wildcard characters: False 70 | ``` 71 | 72 | ### CommonParameters 73 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 74 | 75 | ## INPUTS 76 | 77 | ## OUTPUTS 78 | 79 | ## NOTES 80 | 81 | ## RELATED LINKS 82 | -------------------------------------------------------------------------------- /PSGSuite/Public/Security/Remove-GSMobileDevice.ps1: -------------------------------------------------------------------------------- 1 | function Remove-GSMobileDevice { 2 | <# 3 | .SYNOPSIS 4 | Removes a mobile device from Device Management 5 | 6 | .DESCRIPTION 7 | Removes a mobile device from Device Management 8 | 9 | .PARAMETER ResourceID 10 | The unique Id of the mobile device you would like to remove 11 | 12 | .EXAMPLE 13 | Remove-GSMobileDevice -ResourceId 'AFiQxQ8Qgd-rouSmcd2UnuvhYV__WXdacTgJhPEA1QoQJrK1hYbKJXm-8JFlhZOjBF4aVbhleS2FVQk5lI069K2GULpteTlLVpKLJFSLSL' 14 | 15 | Removes the mobile device with the specified Id 16 | #> 17 | [cmdletbinding(SupportsShouldProcess = $true,ConfirmImpact = "High")] 18 | Param 19 | ( 20 | [parameter(Mandatory = $true,ValueFromPipelineByPropertyName = $true)] 21 | [ValidateNotNullOrEmpty()] 22 | [String[]] 23 | $ResourceId 24 | ) 25 | Begin { 26 | $serviceParams = @{ 27 | Scope = 'https://www.googleapis.com/auth/admin.directory.device.mobile' 28 | ServiceType = 'Google.Apis.Admin.Directory.directory_v1.DirectoryService' 29 | } 30 | $service = New-GoogleService @serviceParams 31 | } 32 | Process { 33 | try { 34 | foreach ($R in $ResourceId) { 35 | if ($PSCmdlet.ShouldProcess("Removing Mobile Device '$R'")) { 36 | Write-Verbose "Removing Mobile Device '$R'" 37 | $request = $service.Mobiledevices.Delete($Script:PSGSuite.CustomerID,$R) 38 | $request.Execute() 39 | Write-Verbose "Mobile Device '$R' has been successfully removed" 40 | } 41 | } 42 | } 43 | catch { 44 | if ($ErrorActionPreference -eq 'Stop') { 45 | $PSCmdlet.ThrowTerminatingError($_) 46 | } 47 | else { 48 | Write-Error $_ 49 | } 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /docs/pages/function_help/Security/Get-GSUserASP.md: -------------------------------------------------------------------------------- 1 | # Get-GSUserASP 2 | 3 | ## SYNOPSIS 4 | Gets Application Specific Passwords for a user 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | Get-GSUserASP [[-User] ] [[-CodeId] ] [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Gets Application Specific Passwords for a user 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | Get-GSUserASP 20 | ``` 21 | 22 | Gets the list of Application Specific Passwords for the user 23 | 24 | ## PARAMETERS 25 | 26 | ### -CodeId 27 | The ID of the ASP you would like info for. 28 | If excluded, returns the full list of ASP's for the user 29 | 30 | ```yaml 31 | Type: String 32 | Parameter Sets: (All) 33 | Aliases: 34 | 35 | Required: False 36 | Position: 2 37 | Default value: None 38 | Accept pipeline input: True (ByPropertyName) 39 | Accept wildcard characters: False 40 | ``` 41 | 42 | ### -User 43 | The primary email or UserID of the user who you are trying to get info for. 44 | You can exclude the '@domain.com' to insert the Domain in the config or use the special 'me' to indicate the AdminEmail in the config. 45 | 46 | Defaults to the AdminEmail in the config 47 | 48 | ```yaml 49 | Type: String[] 50 | Parameter Sets: (All) 51 | Aliases: PrimaryEmail, UserKey, Mail 52 | 53 | Required: False 54 | Position: 1 55 | Default value: $Script:PSGSuite.AdminEmail 56 | Accept pipeline input: True (ByPropertyName, ByValue) 57 | Accept wildcard characters: False 58 | ``` 59 | 60 | ### CommonParameters 61 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 62 | 63 | ## INPUTS 64 | 65 | ## OUTPUTS 66 | 67 | ### Google.Apis.Admin.Directory.directory_v1.Data.Asp 68 | ## NOTES 69 | 70 | ## RELATED LINKS 71 | -------------------------------------------------------------------------------- /PSGSuite/Public/Gmail/Get-GSGmailAutoForwardingSettings.ps1: -------------------------------------------------------------------------------- 1 | function Get-GSGmailAutoForwardingSettings { 2 | <# 3 | .SYNOPSIS 4 | Gets AutoForwarding settings 5 | 6 | .DESCRIPTION 7 | Gets AutoForwarding settings 8 | 9 | .PARAMETER User 10 | The user to get the AutoForwarding settings for 11 | 12 | Defaults to the AdminEmail user 13 | 14 | .EXAMPLE 15 | Get-GSGmailAutoForwardingSettings 16 | 17 | Gets the AutoForwarding settings for the AdminEmail user 18 | #> 19 | [OutputType('Google.Apis.Gmail.v1.Data.AutoForwarding')] 20 | [cmdletbinding()] 21 | Param 22 | ( 23 | [parameter(Mandatory = $false,Position = 0,ValueFromPipelineByPropertyName = $true)] 24 | [Alias("PrimaryEmail","UserKey","Mail")] 25 | [ValidateNotNullOrEmpty()] 26 | [string] 27 | $User = $Script:PSGSuite.AdminEmail 28 | ) 29 | Process { 30 | if ($User -ceq 'me') { 31 | $User = $Script:PSGSuite.AdminEmail 32 | } 33 | elseif ($User -notlike "*@*.*") { 34 | $User = "$($User)@$($Script:PSGSuite.Domain)" 35 | } 36 | $serviceParams = @{ 37 | Scope = 'https://www.googleapis.com/auth/gmail.settings.basic' 38 | ServiceType = 'Google.Apis.Gmail.v1.GmailService' 39 | User = $User 40 | } 41 | $service = New-GoogleService @serviceParams 42 | try { 43 | $request = $service.Users.Settings.GetAutoForwarding($User) 44 | Write-Verbose "Getting AutoForwarding settings for user '$User'" 45 | $request.Execute() | Add-Member -MemberType NoteProperty -Name 'User' -Value $User -PassThru 46 | } 47 | catch { 48 | if ($ErrorActionPreference -eq 'Stop') { 49 | $PSCmdlet.ThrowTerminatingError($_) 50 | } 51 | else { 52 | Write-Error $_ 53 | } 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /docs/pages/function_help/Roles/Remove-GSAdminRole.md: -------------------------------------------------------------------------------- 1 | # Remove-GSAdminRole 2 | 3 | ## SYNOPSIS 4 | Removes a specific Admin Role or a list of Admin Roles 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | Remove-GSAdminRole [-RoleId] [-WhatIf] [-Confirm] [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Removes a specific Admin Role or a list of Admin Roles 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | Remove-GSAdminRole -RoleId 9191482342768644,9191482342768642 20 | ``` 21 | 22 | Removes the admin roles matching the provided Ids 23 | 24 | ## PARAMETERS 25 | 26 | ### -RoleId 27 | The RoleId(s) you would like to remove 28 | 29 | ```yaml 30 | Type: Int64[] 31 | Parameter Sets: (All) 32 | Aliases: 33 | 34 | Required: True 35 | Position: 1 36 | Default value: None 37 | Accept pipeline input: True (ByPropertyName, ByValue) 38 | Accept wildcard characters: False 39 | ``` 40 | 41 | ### -Confirm 42 | Prompts you for confirmation before running the cmdlet. 43 | 44 | ```yaml 45 | Type: SwitchParameter 46 | Parameter Sets: (All) 47 | Aliases: cf 48 | 49 | Required: False 50 | Position: Named 51 | Default value: None 52 | Accept pipeline input: False 53 | Accept wildcard characters: False 54 | ``` 55 | 56 | ### -WhatIf 57 | Shows what would happen if the cmdlet runs. 58 | The cmdlet is not run. 59 | 60 | ```yaml 61 | Type: SwitchParameter 62 | Parameter Sets: (All) 63 | Aliases: wi 64 | 65 | Required: False 66 | Position: Named 67 | Default value: None 68 | Accept pipeline input: False 69 | Accept wildcard characters: False 70 | ``` 71 | 72 | ### CommonParameters 73 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 74 | 75 | ## INPUTS 76 | 77 | ## OUTPUTS 78 | 79 | ## NOTES 80 | 81 | ## RELATED LINKS 82 | -------------------------------------------------------------------------------- /docs/pages/function_help/Security/Get-GSUserToken.md: -------------------------------------------------------------------------------- 1 | # Get-GSUserToken 2 | 3 | ## SYNOPSIS 4 | Gets security tokens for a user 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | Get-GSUserToken [[-User] ] [[-ClientId] ] [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Gets security tokens for a user 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | Get-GSUserToken -ClientId "Google Chrome" 20 | ``` 21 | 22 | Gets the token info for "Google Chrome" for the AdminEmail user 23 | 24 | ## PARAMETERS 25 | 26 | ### -ClientId 27 | The Id of the client you are trying to get token info for. 28 | If excluded, gets the full list of tokens for the user 29 | 30 | ```yaml 31 | Type: String 32 | Parameter Sets: (All) 33 | Aliases: 34 | 35 | Required: False 36 | Position: 2 37 | Default value: None 38 | Accept pipeline input: True (ByPropertyName) 39 | Accept wildcard characters: False 40 | ``` 41 | 42 | ### -User 43 | The primary email or UserID of the user who you are trying to get info for. 44 | You can exclude the '@domain.com' to insert the Domain in the config or use the special 'me' to indicate the AdminEmail in the config. 45 | 46 | Defaults to the AdminEmail in the config 47 | 48 | ```yaml 49 | Type: String[] 50 | Parameter Sets: (All) 51 | Aliases: PrimaryEmail, UserKey, Mail 52 | 53 | Required: False 54 | Position: 1 55 | Default value: $Script:PSGSuite.AdminEmail 56 | Accept pipeline input: True (ByPropertyName, ByValue) 57 | Accept wildcard characters: False 58 | ``` 59 | 60 | ### CommonParameters 61 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 62 | 63 | ## INPUTS 64 | 65 | ## OUTPUTS 66 | 67 | ### Google.Apis.Admin.Directory.directory_v1.Data.Token 68 | ## NOTES 69 | 70 | ## RELATED LINKS 71 | -------------------------------------------------------------------------------- /docs/pages/function_help/Authentication/Get-GSToken.md: -------------------------------------------------------------------------------- 1 | # Get-GSToken 2 | 3 | ## SYNOPSIS 4 | Requests an Access Token for REST API authentication. 5 | Defaults to 3600 seconds token expiration time. 6 | 7 | ## SYNTAX 8 | 9 | ``` 10 | Get-GSToken [-Scopes] [[-AdminEmail] ] [] 11 | ``` 12 | 13 | ## DESCRIPTION 14 | Requests an Access Token for REST API authentication. 15 | Defaults to 3600 seconds token expiration time. 16 | 17 | ## EXAMPLES 18 | 19 | ### EXAMPLE 1 20 | ``` 21 | $Token = Get-GSToken -Scopes 'https://www.google.com/m8/feeds' -AdminEmail $User 22 | ``` 23 | 24 | $headers = @{ 25 | Authorization = "Bearer $($Token)" 26 | 'GData-Version' = '3.0' 27 | } 28 | 29 | ## PARAMETERS 30 | 31 | ### -AdminEmail 32 | The email address of the user to request the token for. 33 | This is typically the Admin user. 34 | 35 | ```yaml 36 | Type: String 37 | Parameter Sets: (All) 38 | Aliases: User 39 | 40 | Required: False 41 | Position: 2 42 | Default value: $Script:PSGSuite.AdminEmail 43 | Accept pipeline input: False 44 | Accept wildcard characters: False 45 | ``` 46 | 47 | ### -Scopes 48 | The list of scopes to request the token for 49 | 50 | ```yaml 51 | Type: String[] 52 | Parameter Sets: (All) 53 | Aliases: Scope 54 | 55 | Required: True 56 | Position: 1 57 | Default value: None 58 | Accept pipeline input: False 59 | Accept wildcard characters: False 60 | ``` 61 | 62 | ### CommonParameters 63 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 64 | 65 | ## INPUTS 66 | 67 | ## OUTPUTS 68 | 69 | ## NOTES 70 | 71 | ## RELATED LINKS 72 | 73 | [https://psgsuite.io/Function%20Help/Authentication/Get-GSToken/](https://psgsuite.io/Function%20Help/Authentication/Get-GSToken/) 74 | 75 | -------------------------------------------------------------------------------- /docs/pages/function_help/Sheets/New-GSSheet.md: -------------------------------------------------------------------------------- 1 | # New-GSSheet 2 | 3 | ## SYNOPSIS 4 | Creates a new SpreadSheet 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | New-GSSheet [[-Title] ] [[-User] ] [-Launch] [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Creates a new SpreadSheet 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | New-GSSheet -Title "Finance Workbook" -Launch 20 | ``` 21 | 22 | Creates a new SpreadSheet titled "Finance Workbook" and opens it in the browser on creation 23 | 24 | ## PARAMETERS 25 | 26 | ### -Launch 27 | If $true, opens the new SpreadSheet Url in your default browser 28 | 29 | ```yaml 30 | Type: SwitchParameter 31 | Parameter Sets: (All) 32 | Aliases: Open 33 | 34 | Required: False 35 | Position: Named 36 | Default value: False 37 | Accept pipeline input: False 38 | Accept wildcard characters: False 39 | ``` 40 | 41 | ### -Title 42 | The name of the new SpreadSheet 43 | 44 | ```yaml 45 | Type: String 46 | Parameter Sets: (All) 47 | Aliases: SheetTitle 48 | 49 | Required: False 50 | Position: 1 51 | Default value: None 52 | Accept pipeline input: False 53 | Accept wildcard characters: False 54 | ``` 55 | 56 | ### -User 57 | The user to create the Sheet for 58 | 59 | ```yaml 60 | Type: String 61 | Parameter Sets: (All) 62 | Aliases: Owner, PrimaryEmail, UserKey, Mail 63 | 64 | Required: False 65 | Position: 2 66 | Default value: $Script:PSGSuite.AdminEmail 67 | Accept pipeline input: True (ByPropertyName) 68 | Accept wildcard characters: False 69 | ``` 70 | 71 | ### CommonParameters 72 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 73 | 74 | ## INPUTS 75 | 76 | ## OUTPUTS 77 | 78 | ### Google.Apis.Sheets.v4.Data.Spreadsheet 79 | ## NOTES 80 | 81 | ## RELATED LINKS 82 | -------------------------------------------------------------------------------- /PSGSuite/Public/Classroom/Remove-GSCourse.ps1: -------------------------------------------------------------------------------- 1 | function Remove-GSCourse { 2 | <# 3 | .SYNOPSIS 4 | Removes an existing course. 5 | 6 | .DESCRIPTION 7 | Removes an existing course. 8 | 9 | .PARAMETER Id 10 | Identifier for this course assigned by Classroom. 11 | 12 | .PARAMETER User 13 | The user to authenticate the request as 14 | 15 | .EXAMPLE 16 | Remove-GSCourse -Id the-republic-s01 -Confirm:$false 17 | #> 18 | [cmdletbinding(SupportsShouldProcess = $true,ConfirmImpact = "High")] 19 | Param 20 | ( 21 | [parameter(Mandatory = $true,Position = 0)] 22 | [Alias('Alias')] 23 | [String] 24 | $Id, 25 | [parameter(Mandatory = $false,ValueFromPipelineByPropertyName = $true)] 26 | [String] 27 | $User = $Script:PSGSuite.AdminEmail 28 | ) 29 | Process { 30 | if ($User -ceq 'me') { 31 | $User = $Script:PSGSuite.AdminEmail 32 | } 33 | elseif ($User -notlike "*@*.*") { 34 | $User = "$($User)@$($Script:PSGSuite.Domain)" 35 | } 36 | $serviceParams = @{ 37 | Scope = 'https://www.googleapis.com/auth/classroom.courses' 38 | ServiceType = 'Google.Apis.Classroom.v1.ClassroomService' 39 | User = $User 40 | } 41 | $service = New-GoogleService @serviceParams 42 | try { 43 | if ($PSCmdlet.ShouldProcess("Removing Course '$Id'")) { 44 | Write-Verbose "Removing Course '$Id'" 45 | $request = $service.Courses.Delete($Id) 46 | $request.Execute() 47 | Write-Verbose "Course '$Id' has been successfully removed" 48 | } 49 | } 50 | catch { 51 | if ($ErrorActionPreference -eq 'Stop') { 52 | $PSCmdlet.ThrowTerminatingError($_) 53 | } 54 | else { 55 | Write-Error $_ 56 | } 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /PSGSuite/Public/Drive/Get-GSDocContent.ps1: -------------------------------------------------------------------------------- 1 | function Get-GSDocContent { 2 | <# 3 | .SYNOPSIS 4 | Gets the content of a Google Doc and returns it as an array of strings. Supports HTML or PlainText 5 | 6 | .DESCRIPTION 7 | Gets the content of a Google Doc and returns it as an array of strings. Supports HTML or PlainText 8 | 9 | .PARAMETER FileID 10 | The unique Id of the file to get content of 11 | 12 | .PARAMETER User 13 | The email or unique Id of the owner of the Drive file 14 | 15 | Defaults to the AdminEmail user 16 | 17 | .PARAMETER Type 18 | Whether to get the results in HTML or PlainText format. 19 | 20 | .EXAMPLE 21 | Get-GSDocContent -FileId '1rhsAYTOB_vrpvfwImPmWy0TcVa2sgmQa_9u976' 22 | 23 | Exports the Drive file as a CSV to the current working directory 24 | #> 25 | [CmdLetBinding()] 26 | Param 27 | ( 28 | [parameter(Mandatory = $true,Position = 0)] 29 | [String] 30 | $FileID, 31 | [parameter(Mandatory = $false,ValueFromPipelineByPropertyName = $true)] 32 | [Alias('Owner','PrimaryEmail','UserKey','Mail')] 33 | [string] 34 | $User = $Script:PSGSuite.AdminEmail, 35 | [parameter(Mandatory = $false)] 36 | [ValidateSet("HTML","PlainText")] 37 | [String] 38 | $Type 39 | ) 40 | Begin { 41 | $typeParam = @{} 42 | if ($PSBoundParameters.Keys -notcontains 'Type') { 43 | $typeParam['Type'] = "PlainText" 44 | } 45 | } 46 | Process { 47 | try { 48 | (Export-GSDriveFile @PSBoundParameters -Projection Minimal @typeParam) -split "`n" 49 | Write-Verbose "Content retrieved for File '$FileID'" 50 | } 51 | catch { 52 | if ($ErrorActionPreference -eq 'Stop') { 53 | $PSCmdlet.ThrowTerminatingError($_) 54 | } 55 | else { 56 | Write-Error $_ 57 | } 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /Tests/0. Mocks/Core.Mocks.ps1: -------------------------------------------------------------------------------- 1 | #region: Mock a config and load it for other functions to use 2 | Mock 'Get-PSGSuiteConfig' -ModuleName PSGSuite -MockWith { 3 | Write-Verbose "Getting mocked PSGSuite config" 4 | $script:PSGSuite = [PSCustomObject][Ordered]@{ 5 | ConfigName = 'Pester' 6 | P12KeyPath = ([System.IO.Path]::Combine($PSScriptRoot,"fake.p12")) 7 | ClientSecretsPath = ([System.IO.Path]::Combine($PSScriptRoot,"fake_client_secrets.json")) 8 | AppEmail = "mock@iam.gserviceaccount.com" 9 | AdminEmail = "admin@domain.com" 10 | CustomerId = 'Cxxxxxxxxx' 11 | Domain = 'domain.com' 12 | Preference = 'CustomerID' 13 | ServiceAccountClientID = '1111111111111111111111111' 14 | } 15 | } 16 | Get-PSGSuiteConfig -Verbose 17 | #endregion 18 | 19 | #region purpose: Base classes 20 | class GoogleRequest { 21 | [String] $Customer 22 | [String] $CustomFieldMask 23 | [String] $Domain 24 | [String] $Fields 25 | [String] $Key 26 | [Int] $MaxResults 27 | [String] $OauthToken 28 | [String] $PageToken 29 | [Bool] $PrettyPrint 30 | [String] $Query 31 | [String] $QuotaUser 32 | [String] $ShowDeleted 33 | 34 | GoogleRequest() { 35 | 36 | } 37 | 38 | [Object[]] Execute() { 39 | throw "Must Override Method" 40 | } 41 | [Object[]] ExecuteAsStream() { 42 | throw "Must Override Method" 43 | } 44 | [Object[]] ExecuteAsStreamAsync() { 45 | throw "Must Override Method" 46 | } 47 | [Object[]] ExecuteAsync() { 48 | throw "Must Override Method" 49 | } 50 | } 51 | class GoogleService { 52 | [String] $APIKey 53 | [String] $ApplicationName = $null 54 | [String] $BasePath 55 | [String] $BaseUri 56 | [String] $BatchPath 57 | [String] $BatchUri 58 | [System.Collections.Generic.List[String]] $Features 59 | [Bool] $GZipEnabled 60 | [String] $Name 61 | 62 | GoogleService() { 63 | 64 | } 65 | } 66 | #endregion 67 | -------------------------------------------------------------------------------- /docs/pages/function_help/Gmail/Add-GSGmailForwardingAddress.md: -------------------------------------------------------------------------------- 1 | # Add-GSGmailForwardingAddress 2 | 3 | ## SYNOPSIS 4 | Creates a forwarding address. 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | Add-GSGmailForwardingAddress [-ForwardingAddress] [[-User] ] [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Creates a forwarding address. 14 | If ownership verification is required, a message will be sent to the recipient and the resource's verification status will be set to pending; otherwise, the resource will be created with verification status set to accepted. 15 | 16 | ## EXAMPLES 17 | 18 | ### EXAMPLE 1 19 | ``` 20 | Add-GSGmailForwardingAddress "joe@domain.com" 21 | ``` 22 | 23 | Adds joe@domain.com as a forwarding address for the AdminEmail user 24 | 25 | ## PARAMETERS 26 | 27 | ### -ForwardingAddress 28 | An email address to which messages can be forwarded. 29 | 30 | ```yaml 31 | Type: String[] 32 | Parameter Sets: (All) 33 | Aliases: Id 34 | 35 | Required: True 36 | Position: 1 37 | Default value: None 38 | Accept pipeline input: True (ByPropertyName) 39 | Accept wildcard characters: False 40 | ``` 41 | 42 | ### -User 43 | The user to create the forwarding addresses for 44 | 45 | Defaults to the AdminEmail user 46 | 47 | ```yaml 48 | Type: String 49 | Parameter Sets: (All) 50 | Aliases: PrimaryEmail, UserKey, Mail 51 | 52 | Required: False 53 | Position: 1 54 | Default value: $Script:PSGSuite.AdminEmail 55 | Accept pipeline input: True (ByPropertyName) 56 | Accept wildcard characters: False 57 | ``` 58 | 59 | ### CommonParameters 60 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 61 | 62 | ## INPUTS 63 | 64 | ## OUTPUTS 65 | 66 | ### Google.Apis.Gmail.v1.Data.ForwardingAddress 67 | ## NOTES 68 | 69 | ## RELATED LINKS 70 | -------------------------------------------------------------------------------- /docs/pages/function_help/Schemas/Remove-GSUserSchema.md: -------------------------------------------------------------------------------- 1 | # Remove-GSUserSchema 2 | 3 | ## SYNOPSIS 4 | Removes a custom user schema 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | Remove-GSUserSchema [[-SchemaId] ] [-WhatIf] [-Confirm] [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Removes a custom user schema 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | Remove-GSUserSchema 2SV 20 | ``` 21 | 22 | Removes the custom user schema named '2SV' after confirmation 23 | 24 | ## PARAMETERS 25 | 26 | ### -SchemaId 27 | The SchemaId or SchemaName to remove. 28 | If excluded, all Custom User Schemas for the customer will be removed 29 | 30 | ```yaml 31 | Type: String[] 32 | Parameter Sets: (All) 33 | Aliases: Schema, SchemaKey, SchemaName 34 | 35 | Required: False 36 | Position: 1 37 | Default value: None 38 | Accept pipeline input: True (ByPropertyName) 39 | Accept wildcard characters: False 40 | ``` 41 | 42 | ### -Confirm 43 | Prompts you for confirmation before running the cmdlet. 44 | 45 | ```yaml 46 | Type: SwitchParameter 47 | Parameter Sets: (All) 48 | Aliases: cf 49 | 50 | Required: False 51 | Position: Named 52 | Default value: None 53 | Accept pipeline input: False 54 | Accept wildcard characters: False 55 | ``` 56 | 57 | ### -WhatIf 58 | Shows what would happen if the cmdlet runs. 59 | The cmdlet is not run. 60 | 61 | ```yaml 62 | Type: SwitchParameter 63 | Parameter Sets: (All) 64 | Aliases: wi 65 | 66 | Required: False 67 | Position: Named 68 | Default value: None 69 | Accept pipeline input: False 70 | Accept wildcard characters: False 71 | ``` 72 | 73 | ### CommonParameters 74 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 75 | 76 | ## INPUTS 77 | 78 | ## OUTPUTS 79 | 80 | ## NOTES 81 | 82 | ## RELATED LINKS 83 | -------------------------------------------------------------------------------- /docs/pages/function_help/Schemas/New-GSUserSchema.md: -------------------------------------------------------------------------------- 1 | # New-GSUserSchema 2 | 3 | ## SYNOPSIS 4 | Creates a new user schema 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | New-GSUserSchema [-SchemaName] [-Fields] [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Creates a new user schema 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | New-GSUserSchema -SchemaName "SDK" -Fields (Add-GSUserSchemaField -FieldName "string" -FieldType STRING -ReadAccessType ADMINS_AND_SELF),(Add-GSUserSchemaField -FieldName "date" -FieldType DATE -ReadAccessType ADMINS_AND_SELF) 20 | ``` 21 | 22 | This command will create a schema named "SDK" with two fields, "string" and "date", readable by ADMINS_AND_SELF 23 | 24 | ## PARAMETERS 25 | 26 | ### -Fields 27 | New schema fields to set 28 | 29 | Expects SchemaFieldSpec objects. 30 | You can create these with the helper function Add-GSUserSchemaField, i.e.: Add-GSUserSchemaField -FieldName "date" -FieldType DATE -ReadAccessType ADMINS_AND_SELF 31 | 32 | ```yaml 33 | Type: SchemaFieldSpec[] 34 | Parameter Sets: (All) 35 | Aliases: 36 | 37 | Required: True 38 | Position: 2 39 | Default value: None 40 | Accept pipeline input: False 41 | Accept wildcard characters: False 42 | ``` 43 | 44 | ### -SchemaName 45 | The name of the schema to create 46 | 47 | ```yaml 48 | Type: String 49 | Parameter Sets: (All) 50 | Aliases: 51 | 52 | Required: True 53 | Position: 1 54 | Default value: None 55 | Accept pipeline input: False 56 | Accept wildcard characters: False 57 | ``` 58 | 59 | ### CommonParameters 60 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 61 | 62 | ## INPUTS 63 | 64 | ## OUTPUTS 65 | 66 | ### Google.Apis.Admin.Directory.directory_v1.Data.Schema 67 | ## NOTES 68 | 69 | ## RELATED LINKS 70 | -------------------------------------------------------------------------------- /PSGSuite/Public/Gmail/Get-GSGmailProfile.ps1: -------------------------------------------------------------------------------- 1 | function Get-GSGmailProfile { 2 | <# 3 | .SYNOPSIS 4 | Gets Gmail profile for the user 5 | 6 | .DESCRIPTION 7 | Gets Gmail profile for the user 8 | 9 | .PARAMETER User 10 | The user to get profile of 11 | 12 | Defaults to the AdminEmail user 13 | 14 | .EXAMPLE 15 | Get-GSGmailProfile 16 | 17 | Gets the Gmail profile of the AdminEmail user 18 | #> 19 | [OutputType('Google.Apis.Gmail.v1.Data.Profile')] 20 | [cmdletbinding()] 21 | Param 22 | ( 23 | [parameter(Mandatory = $false,Position = 0,ValueFromPipelineByPropertyName = $true)] 24 | [Alias("PrimaryEmail","UserKey","Mail")] 25 | [ValidateNotNullOrEmpty()] 26 | [String[]] 27 | $User = $Script:PSGSuite.AdminEmail 28 | ) 29 | Process { 30 | foreach ($U in $User) { 31 | try { 32 | if ($U -ceq 'me') { 33 | $U = $Script:PSGSuite.AdminEmail 34 | } 35 | elseif ($U -notlike "*@*.*") { 36 | $U = "$($U)@$($Script:PSGSuite.Domain)" 37 | } 38 | $serviceParams = @{ 39 | Scope = 'https://mail.google.com' 40 | ServiceType = 'Google.Apis.Gmail.v1.GmailService' 41 | User = $U 42 | } 43 | $service = New-GoogleService @serviceParams 44 | $request = $service.Users.GetProfile($U) 45 | Write-Verbose "Getting Gmail profile for user '$U'" 46 | $request.Execute() | Add-Member -MemberType NoteProperty -Name 'User' -Value $U -PassThru 47 | } 48 | catch { 49 | if ($ErrorActionPreference -eq 'Stop') { 50 | $PSCmdlet.ThrowTerminatingError($_) 51 | } 52 | else { 53 | Write-Error $_ 54 | } 55 | } 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /docs/pages/function_help/Chat/Remove-GSChatMessage.md: -------------------------------------------------------------------------------- 1 | # Remove-GSChatMessage 2 | 3 | ## SYNOPSIS 4 | Removes a Chat message 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | Remove-GSChatMessage [-Name] [-WhatIf] [-Confirm] [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Removes a Chat message 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | Remove-GSChatMessage -Name 'spaces/AAAAMpdlehY/messages/UMxbHmzDlr4.UMxbHmzDlr4' 20 | ``` 21 | 22 | Removes the Chat message specified after confirmation 23 | 24 | ## PARAMETERS 25 | 26 | ### -Name 27 | Resource name of the message to be removed, in the form "spaces/messages". 28 | 29 | Example: spaces/AAAAMpdlehY/messages/UMxbHmzDlr4.UMxbHmzDlr4 30 | 31 | ```yaml 32 | Type: String[] 33 | Parameter Sets: (All) 34 | Aliases: Id 35 | 36 | Required: True 37 | Position: 1 38 | Default value: None 39 | Accept pipeline input: False 40 | Accept wildcard characters: False 41 | ``` 42 | 43 | ### -Confirm 44 | Prompts you for confirmation before running the cmdlet. 45 | 46 | ```yaml 47 | Type: SwitchParameter 48 | Parameter Sets: (All) 49 | Aliases: cf 50 | 51 | Required: False 52 | Position: Named 53 | Default value: None 54 | Accept pipeline input: False 55 | Accept wildcard characters: False 56 | ``` 57 | 58 | ### -WhatIf 59 | Shows what would happen if the cmdlet runs. 60 | The cmdlet is not run. 61 | 62 | ```yaml 63 | Type: SwitchParameter 64 | Parameter Sets: (All) 65 | Aliases: wi 66 | 67 | Required: False 68 | Position: Named 69 | Default value: None 70 | Accept pipeline input: False 71 | Accept wildcard characters: False 72 | ``` 73 | 74 | ### CommonParameters 75 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 76 | 77 | ## INPUTS 78 | 79 | ## OUTPUTS 80 | 81 | ## NOTES 82 | 83 | ## RELATED LINKS 84 | -------------------------------------------------------------------------------- /docs/pages/function_help/Tasks/Update-GSTasklist.md: -------------------------------------------------------------------------------- 1 | # Update-GSTasklist 2 | 3 | ## SYNOPSIS 4 | Updates a Tasklist title 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | Update-GSTasklist [-Tasklist] [-Title] [-User ] [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Updates a Tasklist title 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | Update-GSTasklist -Tasklist 'MTA3NjIwMjA1NTEzOTk0MjQ0OTk6NTMyNDY5NDk1NDM5MzMxOTow' -Title 'Hi-Pri Callbacks' 20 | ``` 21 | 22 | Updates the specified TaskList with the new title 'Hi-Pri Callbacks' 23 | 24 | ## PARAMETERS 25 | 26 | ### -Tasklist 27 | The unique Id of the Tasklist to update 28 | 29 | ```yaml 30 | Type: String 31 | Parameter Sets: (All) 32 | Aliases: 33 | 34 | Required: True 35 | Position: 1 36 | Default value: None 37 | Accept pipeline input: False 38 | Accept wildcard characters: False 39 | ``` 40 | 41 | ### -Title 42 | The new title of the Tasklist 43 | 44 | ```yaml 45 | Type: String 46 | Parameter Sets: (All) 47 | Aliases: 48 | 49 | Required: True 50 | Position: 2 51 | Default value: None 52 | Accept pipeline input: False 53 | Accept wildcard characters: False 54 | ``` 55 | 56 | ### -User 57 | The User who owns the Tasklist. 58 | 59 | Defaults to the AdminUser's email. 60 | 61 | ```yaml 62 | Type: String 63 | Parameter Sets: (All) 64 | Aliases: PrimaryEmail, UserKey, Mail, Email 65 | 66 | Required: False 67 | Position: Named 68 | Default value: $Script:PSGSuite.AdminEmail 69 | Accept pipeline input: True (ByPropertyName) 70 | Accept wildcard characters: False 71 | ``` 72 | 73 | ### CommonParameters 74 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 75 | 76 | ## INPUTS 77 | 78 | ## OUTPUTS 79 | 80 | ### Google.Apis.Tasks.v1.Data.TaskList 81 | ## NOTES 82 | 83 | ## RELATED LINKS 84 | -------------------------------------------------------------------------------- /docs/pages/function_help/Drive/Get-GSDriveFolderSize.md: -------------------------------------------------------------------------------- 1 | # Get-GSDriveFolderSize 2 | 3 | ## SYNOPSIS 4 | Gets the size of the files with the specified ParentFolderId in Drive. 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | Get-GSDriveFolderSize [-ParentFolderId] [-Recurse] [-Depth ] [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Gets the size of the files with the specified ParentFolderId in Drive. 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | Get-GSDriveFolderSize -ParentFolderId $id1,$id2 -Recurse 20 | ``` 21 | 22 | ## PARAMETERS 23 | 24 | ### -Depth 25 | Internal use only. 26 | Used to track how deep in the subfolder structure the command is currently searching when used with -Verbose 27 | 28 | ```yaml 29 | Type: Int32 30 | Parameter Sets: (All) 31 | Aliases: 32 | 33 | Required: False 34 | Position: Named 35 | Default value: 0 36 | Accept pipeline input: False 37 | Accept wildcard characters: False 38 | ``` 39 | 40 | ### -ParentFolderId 41 | ID of parent folder to search to add to the filter 42 | 43 | ```yaml 44 | Type: String[] 45 | Parameter Sets: (All) 46 | Aliases: Id 47 | 48 | Required: True 49 | Position: 1 50 | Default value: None 51 | Accept pipeline input: True (ByPropertyName) 52 | Accept wildcard characters: False 53 | ``` 54 | 55 | ### -Recurse 56 | If True, recurses through subfolders found underneath primary search results 57 | 58 | ```yaml 59 | Type: SwitchParameter 60 | Parameter Sets: (All) 61 | Aliases: 62 | 63 | Required: False 64 | Position: Named 65 | Default value: False 66 | Accept pipeline input: False 67 | Accept wildcard characters: False 68 | ``` 69 | 70 | ### CommonParameters 71 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 72 | 73 | ## INPUTS 74 | 75 | ## OUTPUTS 76 | 77 | ## NOTES 78 | 79 | ## RELATED LINKS 80 | -------------------------------------------------------------------------------- /PSGSuite/Public/Roles/Remove-GSAdminRole.ps1: -------------------------------------------------------------------------------- 1 | function Remove-GSAdminRole { 2 | <# 3 | .SYNOPSIS 4 | Removes a specific Admin Role or a list of Admin Roles 5 | 6 | .DESCRIPTION 7 | Removes a specific Admin Role or a list of Admin Roles 8 | 9 | .PARAMETER RoleId 10 | The RoleId(s) you would like to remove 11 | 12 | .EXAMPLE 13 | Remove-GSAdminRole -RoleId 9191482342768644,9191482342768642 14 | 15 | Removes the admin roles matching the provided Ids 16 | #> 17 | [cmdletbinding(SupportsShouldProcess = $true,ConfirmImpact = "High")] 18 | Param 19 | ( 20 | [parameter(Mandatory = $true,Position = 0,ValueFromPipeline = $true,ValueFromPipelineByPropertyName = $true)] 21 | [int64[]] 22 | $RoleId 23 | ) 24 | Begin { 25 | $serviceParams = @{ 26 | Scope = 'https://www.googleapis.com/auth/admin.directory.rolemanagement' 27 | ServiceType = 'Google.Apis.Admin.Directory.directory_v1.DirectoryService' 28 | } 29 | $service = New-GoogleService @serviceParams 30 | $customerId = if ($Script:PSGSuite.CustomerID) { 31 | $Script:PSGSuite.CustomerID 32 | } 33 | else { 34 | 'my_customer' 35 | } 36 | } 37 | Process { 38 | foreach ($Role in $RoleId) { 39 | try { 40 | if ($PSCmdlet.ShouldProcess("Deleting Role Id '$Role'")) { 41 | Write-Verbose "Deleting Role Id '$Role'" 42 | $request = $service.Roles.Delete($customerId,$Role) 43 | $request.Execute() 44 | Write-Verbose "Role Id '$Role' has been successfully deleted" 45 | } 46 | } 47 | catch { 48 | if ($ErrorActionPreference -eq 'Stop') { 49 | $PSCmdlet.ThrowTerminatingError($_) 50 | } 51 | else { 52 | Write-Error $_ 53 | } 54 | } 55 | } 56 | } 57 | } -------------------------------------------------------------------------------- /docs/pages/function_help/Roles/New-GSAdminRole.md: -------------------------------------------------------------------------------- 1 | # New-GSAdminRole 2 | 3 | ## SYNOPSIS 4 | Creates a new Admin Role 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | New-GSAdminRole [-RoleName] [-RolePrivileges] [-RoleDescription ] 10 | [] 11 | ``` 12 | 13 | ## DESCRIPTION 14 | Creates a new Admin Role 15 | 16 | ## EXAMPLES 17 | 18 | ### EXAMPLE 1 19 | ``` 20 | Get-GSAdminRole 21 | ``` 22 | 23 | Gets the list of Admin Roles 24 | 25 | ### EXAMPLE 2 26 | ``` 27 | Get-GSAdminRole -RoleId '9191482342768644','9191482342768642' 28 | ``` 29 | 30 | Gets the admin roles matching the provided Ids 31 | 32 | ## PARAMETERS 33 | 34 | ### -RoleDescription 35 | A short description of the role. 36 | 37 | ```yaml 38 | Type: String 39 | Parameter Sets: (All) 40 | Aliases: 41 | 42 | Required: False 43 | Position: Named 44 | Default value: None 45 | Accept pipeline input: False 46 | Accept wildcard characters: False 47 | ``` 48 | 49 | ### -RoleName 50 | The name of the new role 51 | 52 | ```yaml 53 | Type: String 54 | Parameter Sets: (All) 55 | Aliases: 56 | 57 | Required: True 58 | Position: 1 59 | Default value: None 60 | Accept pipeline input: False 61 | Accept wildcard characters: False 62 | ``` 63 | 64 | ### -RolePrivileges 65 | The set of privileges that are granted to this role. 66 | 67 | ```yaml 68 | Type: RolePrivilegesData[] 69 | Parameter Sets: (All) 70 | Aliases: 71 | 72 | Required: True 73 | Position: 2 74 | Default value: None 75 | Accept pipeline input: True (ByPropertyName, ByValue) 76 | Accept wildcard characters: False 77 | ``` 78 | 79 | ### CommonParameters 80 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 81 | 82 | ## INPUTS 83 | 84 | ## OUTPUTS 85 | 86 | ### Google.Apis.Admin.Directory.directory_v1.Data.Role 87 | ## NOTES 88 | 89 | ## RELATED LINKS 90 | -------------------------------------------------------------------------------- /docs/pages/function_help/Configuration/Switch-PSGSuiteConfig.md: -------------------------------------------------------------------------------- 1 | # Switch-PSGSuiteConfig 2 | 3 | ## SYNOPSIS 4 | Switches the active config 5 | 6 | ## SYNTAX 7 | 8 | ### ConfigName (Default) 9 | ``` 10 | Switch-PSGSuiteConfig [-SetToDefault] -ConfigName [] 11 | ``` 12 | 13 | ### Domain 14 | ``` 15 | Switch-PSGSuiteConfig -Domain [-SetToDefault] [] 16 | ``` 17 | 18 | ## DESCRIPTION 19 | Switches the active config 20 | 21 | ## EXAMPLES 22 | 23 | ### EXAMPLE 1 24 | ``` 25 | Switch-PSGSuiteConfig newCustomer 26 | ``` 27 | 28 | Switches the config to the "newCustomer" config 29 | 30 | ## PARAMETERS 31 | 32 | ### -ConfigName 33 | {{ Fill ConfigName Description }} 34 | 35 | ```yaml 36 | Type: String 37 | Parameter Sets: ConfigName 38 | Aliases: 39 | 40 | Required: True 41 | Position: Named 42 | Default value: None 43 | Accept pipeline input: False 44 | Accept wildcard characters: False 45 | ``` 46 | 47 | ### -Domain 48 | The domain name for the config you would like to set as active for the session 49 | 50 | ```yaml 51 | Type: String 52 | Parameter Sets: Domain 53 | Aliases: 54 | 55 | Required: True 56 | Position: Named 57 | Default value: None 58 | Accept pipeline input: False 59 | Accept wildcard characters: False 60 | ``` 61 | 62 | ### -SetToDefault 63 | If passed, also sets the specified config as the default so it's loaded on the next module import 64 | 65 | ```yaml 66 | Type: SwitchParameter 67 | Parameter Sets: (All) 68 | Aliases: 69 | 70 | Required: False 71 | Position: Named 72 | Default value: False 73 | Accept pipeline input: False 74 | Accept wildcard characters: False 75 | ``` 76 | 77 | ### CommonParameters 78 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 79 | 80 | ## INPUTS 81 | 82 | ## OUTPUTS 83 | 84 | ## NOTES 85 | 86 | ## RELATED LINKS 87 | -------------------------------------------------------------------------------- /docs/pages/function_help/Security/Remove-GSMobileDevice.md: -------------------------------------------------------------------------------- 1 | # Remove-GSMobileDevice 2 | 3 | ## SYNOPSIS 4 | Removes a mobile device from Device Management 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | Remove-GSMobileDevice [-ResourceId] [-WhatIf] [-Confirm] [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Removes a mobile device from Device Management 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | Remove-GSMobileDevice -ResourceId 'AFiQxQ8Qgd-rouSmcd2UnuvhYV__WXdacTgJhPEA1QoQJrK1hYbKJXm-8JFlhZOjBF4aVbhleS2FVQk5lI069K2GULpteTlLVpKLJFSLSL' 20 | ``` 21 | 22 | Removes the mobile device with the specified Id 23 | 24 | ## PARAMETERS 25 | 26 | ### -ResourceId 27 | The unique Id of the mobile device you would like to remove 28 | 29 | ```yaml 30 | Type: String[] 31 | Parameter Sets: (All) 32 | Aliases: 33 | 34 | Required: True 35 | Position: 1 36 | Default value: None 37 | Accept pipeline input: True (ByPropertyName) 38 | Accept wildcard characters: False 39 | ``` 40 | 41 | ### -Confirm 42 | Prompts you for confirmation before running the cmdlet. 43 | 44 | ```yaml 45 | Type: SwitchParameter 46 | Parameter Sets: (All) 47 | Aliases: cf 48 | 49 | Required: False 50 | Position: Named 51 | Default value: None 52 | Accept pipeline input: False 53 | Accept wildcard characters: False 54 | ``` 55 | 56 | ### -WhatIf 57 | Shows what would happen if the cmdlet runs. 58 | The cmdlet is not run. 59 | 60 | ```yaml 61 | Type: SwitchParameter 62 | Parameter Sets: (All) 63 | Aliases: wi 64 | 65 | Required: False 66 | Position: Named 67 | Default value: None 68 | Accept pipeline input: False 69 | Accept wildcard characters: False 70 | ``` 71 | 72 | ### CommonParameters 73 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 74 | 75 | ## INPUTS 76 | 77 | ## OUTPUTS 78 | 79 | ## NOTES 80 | 81 | ## RELATED LINKS 82 | -------------------------------------------------------------------------------- /PSGSuite/Public/Gmail/Get-GSGmailLanguageSettings.ps1: -------------------------------------------------------------------------------- 1 | function Get-GSGmailLanguageSettings { 2 | <# 3 | .SYNOPSIS 4 | Gets Gmail display language settings 5 | 6 | .DESCRIPTION 7 | Gets Gmail display language settings 8 | 9 | .PARAMETER User 10 | The user to get the Gmail display language settings for. 11 | 12 | Defaults to the AdminEmail user. 13 | 14 | .EXAMPLE 15 | Get-GSGmailLanguageSettings -User me 16 | 17 | Gets the Gmail display language for the AdminEmail user. 18 | #> 19 | [OutputType('Google.Apis.Gmail.v1.Data.LanguageSettings')] 20 | [cmdletbinding()] 21 | Param ( 22 | [parameter(Position = 0,ValueFromPipelineByPropertyName = $true)] 23 | [Alias("PrimaryEmail","UserKey","Mail")] 24 | [ValidateNotNullOrEmpty()] 25 | [string[]] 26 | $User = $Script:PSGSuite.AdminEmail 27 | ) 28 | Process { 29 | foreach ($U in $User) { 30 | if ($U -ceq 'me') { 31 | $U = $Script:PSGSuite.AdminEmail 32 | } 33 | elseif ($U -notlike "*@*.*") { 34 | $U = "$($U)@$($Script:PSGSuite.Domain)" 35 | } 36 | $serviceParams = @{ 37 | Scope = 'https://www.googleapis.com/auth/gmail.settings.basic' 38 | ServiceType = 'Google.Apis.Gmail.v1.GmailService' 39 | User = $U 40 | } 41 | $service = New-GoogleService @serviceParams 42 | try { 43 | $request = $service.Users.Settings.GetLanguage($U) 44 | Write-Verbose "Getting Gmail Display Language for user '$U'" 45 | $request.Execute() | Add-Member -MemberType NoteProperty -Name 'User' -Value $U -PassThru 46 | } 47 | catch { 48 | if ($ErrorActionPreference -eq 'Stop') { 49 | $PSCmdlet.ThrowTerminatingError($_) 50 | } 51 | else { 52 | Write-Error $_ 53 | } 54 | } 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /PSGSuite/Public/Security/Revoke-GSUserVerificationCodes.ps1: -------------------------------------------------------------------------------- 1 | function Revoke-GSUserVerificationCodes { 2 | <# 3 | .SYNOPSIS 4 | Revokes/invalidates Verification Codes for the user 5 | 6 | .DESCRIPTION 7 | Revokes/invalidates Verification Codes for the user 8 | 9 | .PARAMETER User 10 | The user to revoke verification codes from 11 | 12 | .EXAMPLE 13 | Revoke-GSUserVerificationCodes -User me -Confirm:$false 14 | 15 | Invalidates the verification codes for the AdminEmail user, skipping confirmation 16 | #> 17 | [cmdletbinding()] 18 | Param 19 | ( 20 | [parameter(Mandatory = $false,Position = 0,ValueFromPipeline = $true,ValueFromPipelineByPropertyName = $true)] 21 | [Alias("PrimaryEmail","UserKey","Mail")] 22 | [ValidateNotNullOrEmpty()] 23 | [String[]] 24 | $User 25 | ) 26 | Begin { 27 | $serviceParams = @{ 28 | Scope = 'https://www.googleapis.com/auth/admin.directory.user.security' 29 | ServiceType = 'Google.Apis.Admin.Directory.directory_v1.DirectoryService' 30 | } 31 | $service = New-GoogleService @serviceParams 32 | } 33 | Process { 34 | try { 35 | foreach ($U in $User) { 36 | if ($U -ceq 'me') { 37 | $U = $Script:PSGSuite.AdminEmail 38 | } 39 | elseif ($U -notlike "*@*.*") { 40 | $U = "$($U)@$($Script:PSGSuite.Domain)" 41 | } 42 | Write-Verbose "Invalidating verification codes for user '$U'" 43 | $request = $service.VerificationCodes.Invalidate($U) 44 | $request.Execute() 45 | Write-Verbose "Verification codes successfully invalidated for user '$U'" 46 | } 47 | } 48 | catch { 49 | if ($ErrorActionPreference -eq 'Stop') { 50 | $PSCmdlet.ThrowTerminatingError($_) 51 | } 52 | else { 53 | Write-Error $_ 54 | } 55 | } 56 | } 57 | } -------------------------------------------------------------------------------- /docs/pages/function_help/Configuration/Export-PSGSuiteConfig.md: -------------------------------------------------------------------------------- 1 | # Export-PSGSuiteConfig 2 | 3 | ## SYNOPSIS 4 | Allows you to export an unecrypted PSGSuite config in a portable JSON string format. 5 | Useful for moving a config to a new machine or storing the full as an encrypted string in your CI/CD / Automation tools. 6 | 7 | ## SYNTAX 8 | 9 | ``` 10 | Export-PSGSuiteConfig [[-Path] ] [-ConfigName ] [] 11 | ``` 12 | 13 | ## DESCRIPTION 14 | Allows you to export an unecrypted PSGSuite config in a portable JSON string format. 15 | Useful for moving a config to a new machine or storing the full as an encrypted string in your CI/CD / Automation tools. 16 | 17 | ## EXAMPLES 18 | 19 | ### EXAMPLE 1 20 | ``` 21 | Export-PSGSuiteConfig -ConfigName Personal -Path ".\PSGSuite_personal_config.json" 22 | ``` 23 | 24 | Exports the config named 'Personal' to the path specified. 25 | 26 | ## PARAMETERS 27 | 28 | ### -ConfigName 29 | The config that you would like to export. 30 | Defaults to the currently loaded config. 31 | 32 | ```yaml 33 | Type: String 34 | Parameter Sets: (All) 35 | Aliases: 36 | 37 | Required: False 38 | Position: Named 39 | Default value: $script:PSGSuite.ConfigName 40 | Accept pipeline input: False 41 | Accept wildcard characters: False 42 | ``` 43 | 44 | ### -Path 45 | The path you would like to save the JSON file to. 46 | Defaults to a named path in the current directory. 47 | 48 | ```yaml 49 | Type: String 50 | Parameter Sets: (All) 51 | Aliases: OutPath, OutFile, JsonPath 52 | 53 | Required: False 54 | Position: 1 55 | Default value: None 56 | Accept pipeline input: False 57 | Accept wildcard characters: False 58 | ``` 59 | 60 | ### CommonParameters 61 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 62 | 63 | ## INPUTS 64 | 65 | ## OUTPUTS 66 | 67 | ## NOTES 68 | 69 | ## RELATED LINKS 70 | -------------------------------------------------------------------------------- /docs/pages/function_help/Groups/New-GSGroup.md: -------------------------------------------------------------------------------- 1 | # New-GSGroup 2 | 3 | ## SYNOPSIS 4 | Creates a new Google Group 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | New-GSGroup [-Email] [-Name] [[-Description] ] [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Creates a new Google Group 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | New-GSGroup -Email appdev -Name "Application Developers" -Description "App Dev team members" 20 | ``` 21 | 22 | Creates a new group named "Application Developers" with the email "appdev@domain.com" and description "App Dev team members" 23 | 24 | ## PARAMETERS 25 | 26 | ### -Description 27 | The description of the new group 28 | 29 | ```yaml 30 | Type: String 31 | Parameter Sets: (All) 32 | Aliases: 33 | 34 | Required: False 35 | Position: 3 36 | Default value: None 37 | Accept pipeline input: False 38 | Accept wildcard characters: False 39 | ``` 40 | 41 | ### -Email 42 | The desired email of the new group. 43 | If the group already exists, a GoogleApiException will be thrown. 44 | You can exclude the '@domain.com' to insert the Domain in the config 45 | 46 | ```yaml 47 | Type: String 48 | Parameter Sets: (All) 49 | Aliases: 50 | 51 | Required: True 52 | Position: 1 53 | Default value: None 54 | Accept pipeline input: False 55 | Accept wildcard characters: False 56 | ``` 57 | 58 | ### -Name 59 | The name of the new group 60 | 61 | ```yaml 62 | Type: String 63 | Parameter Sets: (All) 64 | Aliases: 65 | 66 | Required: True 67 | Position: 2 68 | Default value: None 69 | Accept pipeline input: False 70 | Accept wildcard characters: False 71 | ``` 72 | 73 | ### CommonParameters 74 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 75 | 76 | ## INPUTS 77 | 78 | ## OUTPUTS 79 | 80 | ### Google.Apis.Admin.Directory.directory_v1.Data.Group 81 | ## NOTES 82 | 83 | ## RELATED LINKS 84 | -------------------------------------------------------------------------------- /PSGSuite/Private/Convert-Base64.ps1: -------------------------------------------------------------------------------- 1 | function Convert-Base64 { 2 | [cmdletbinding()] 3 | Param 4 | ( 5 | [parameter(Mandatory = $true,Position = 0)] 6 | [ValidateSet("NormalString","Base64String","WebSafeBase64String")] 7 | [ValidateScript( {if ($_ -eq $To) { 8 | throw "The 'From' parameter must not be the same as the 'To' parameter" 9 | } 10 | else { 11 | $true 12 | }})] 13 | [String] 14 | $From, 15 | [parameter(Mandatory = $true,Position = 1)] 16 | [ValidateSet("NormalString","Base64String","WebSafeBase64String")] 17 | [ValidateScript( {if ($_ -eq $From) { 18 | throw "The 'To' parameter must not be the same as the 'From' parameter" 19 | } 20 | else { 21 | $true 22 | }})] 23 | [String] 24 | $To, 25 | [parameter(Mandatory = $true,Position = 2,ValueFromPipeline = $true)] 26 | [String] 27 | $String, 28 | [parameter(Mandatory = $false)] 29 | [String] 30 | $OutFile 31 | ) 32 | if ($From -eq "NormalString") { 33 | $String = [System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes($String)) 34 | } 35 | elseif ($From -eq "WebSafeBase64String") { 36 | $String = $String.Replace('_', '/').Replace('-', '+').Replace('|','=') 37 | switch ($String.Length % 4) { 38 | 2 { 39 | $String += "==" 40 | } 41 | 3 { 42 | $String += "=" 43 | } 44 | } 45 | } 46 | if ($To -eq "NormalString") { 47 | $String = [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($String)) 48 | } 49 | elseif ($To -eq "WebSafeBase64String") { 50 | $String = $String.TrimEnd("=").Replace('+', '-').Replace('/', '_'); 51 | } 52 | if ($OutFile) { 53 | $String | Set-Content $OutFile -Force 54 | } 55 | else { 56 | return $String 57 | } 58 | } -------------------------------------------------------------------------------- /docs/pages/function_help/Gmail/Get-GSGmailFilter.md: -------------------------------------------------------------------------------- 1 | # Get-GSGmailFilter 2 | 3 | ## SYNOPSIS 4 | Gets Gmail filter details 5 | 6 | ## SYNTAX 7 | 8 | ``` 9 | Get-GSGmailFilter [-FilterId ] [[-User] ] [-Raw] [] 10 | ``` 11 | 12 | ## DESCRIPTION 13 | Gets Gmail filter details 14 | 15 | ## EXAMPLES 16 | 17 | ### EXAMPLE 1 18 | ``` 19 | Get-GSGmailFilter -User joe 20 | ``` 21 | 22 | Gets the list of filters for Joe 23 | 24 | ## PARAMETERS 25 | 26 | ### -FilterId 27 | The unique Id of the filter you would like to retrieve information for. 28 | If excluded, all filters for the user are returned 29 | 30 | ```yaml 31 | Type: String[] 32 | Parameter Sets: (All) 33 | Aliases: Id 34 | 35 | Required: False 36 | Position: Named 37 | Default value: None 38 | Accept pipeline input: True (ByPropertyName) 39 | Accept wildcard characters: False 40 | ``` 41 | 42 | ### -Raw 43 | If $true, returns the raw response. 44 | If not passed or -Raw:$false, response is formatted as a flat object for readability 45 | 46 | ```yaml 47 | Type: SwitchParameter 48 | Parameter Sets: (All) 49 | Aliases: 50 | 51 | Required: False 52 | Position: Named 53 | Default value: False 54 | Accept pipeline input: False 55 | Accept wildcard characters: False 56 | ``` 57 | 58 | ### -User 59 | The email of the user you are getting the filter information for 60 | 61 | ```yaml 62 | Type: String 63 | Parameter Sets: (All) 64 | Aliases: PrimaryEmail, UserKey, Mail 65 | 66 | Required: False 67 | Position: 1 68 | Default value: $Script:PSGSuite.AdminEmail 69 | Accept pipeline input: True (ByPropertyName) 70 | Accept wildcard characters: False 71 | ``` 72 | 73 | ### CommonParameters 74 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 75 | 76 | ## INPUTS 77 | 78 | ## OUTPUTS 79 | 80 | ### Google.Apis.Gmail.v1.Data.Filter 81 | ## NOTES 82 | 83 | ## RELATED LINKS 84 | --------------------------------------------------------------------------------