feat: pwsh setup and print credentials comprobation

This commit is contained in:
HugoPBrito
2025-04-21 17:54:12 +02:00
parent b6e1551397
commit a6dd97b6bc
+12 -6
View File
@@ -447,8 +447,11 @@ class M365Provider(Provider):
f"M365 Region: {Fore.YELLOW}{self.region_config.name}{Style.RESET_ALL}",
f"M365 Tenant Domain: {Fore.YELLOW}{self._identity.tenant_domain}{Style.RESET_ALL} M365 Tenant ID: {Fore.YELLOW}{self._identity.tenant_id}{Style.RESET_ALL}",
f"M365 Identity Type: {Fore.YELLOW}{self._identity.identity_type}{Style.RESET_ALL} M365 Identity ID: {Fore.YELLOW}{self._identity.identity_id}{Style.RESET_ALL}",
f"M365 User: {Fore.YELLOW}{self.credentials.user}{Style.RESET_ALL}",
]
if self.credentials and self.credentials.user:
report_lines.append(
f"M365 User: {Fore.YELLOW}{self.credentials.user}{Style.RESET_ALL}"
)
report_title = (
f"{Style.BRIGHT}Using the M365 credentials below:{Style.RESET_ALL}"
)
@@ -700,11 +703,14 @@ class M365Provider(Provider):
logger.info("M365 provider: Connection to MSGraph successful")
# Set up PowerShell credentials
M365Provider.setup_powershell(
env_auth,
m365_credentials,
provider_id,
)
if user and encrypted_password:
M365Provider.setup_powershell(
env_auth,
m365_credentials,
provider_id,
)
else:
logger.info("M365 provider: PowerShell authentication not required")
logger.info("M365 provider: Connection to PowerShell successful")