Created
January 8, 2019 15:14
-
-
Save andikrueger/fe000c3cf8b5e09322a18cb64f006b33 to your computer and use it in GitHub Desktop.
Creating SQL Server Alias based on a hash table with iteration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ConfigurationData.NonNodeData.SqlServerAlias.Keys | ForEach-Object -Process { | |
SqlAlias $ConfigurationData.NonNodeData.SqlServerAlias[$_].Name | |
{ | |
Name = $ConfigurationData.NonNodeData.SqlServerAlias[$_].Name | |
ServerName = $ConfigurationData.NonNodeData.SqlServerAlias[$_].ServerName | |
Protocol = $ConfigurationData.NonNodeData.SqlServerAlias[$_].Protocol | |
UseDynamicTcpPort = $ConfigurationData.NonNodeData.SqlServerAlias[$_].UseDynamicTcpPort | |
TcpPort = $ConfigurationData.NonNodeData.SqlServerAlias[$_].TcpPort | |
Ensure = 'Present' | |
PsDscRunAsCredential = $SpSetupAccount | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment