Tags
#Agile #Docs #Powershell #SQL
Question

How to specifies the details of the output Excel file ?

- server name

- instance name

- timestamp

The next section of code specifies the details of the output Excel file. It will take the name of the server, the name of the instance and put a timestamp on the file. The timestamp is in the file is important to know when the file was created especially when you document your servers regularly.

# Create timestamp
$timestamp = Get-Date -f yyyyddMMHHmmss # Set the destination$outputFile = $destination + '\MachineInformation_' + ($server).ToUpper() + '_' + ($instance).ToUpper() + '_' +$timestamp + '.xlsx'


Tags
#Agile #Docs #Powershell #SQL
Question

How to specifies the details of the output Excel file ?

- server name

- instance name

- timestamp

?

Tags
#Agile #Docs #Powershell #SQL
Question

How to specifies the details of the output Excel file ?

- server name

- instance name

- timestamp

The next section of code specifies the details of the output Excel file. It will take the name of the server, the name of the instance and put a timestamp on the file. The timestamp is in the file is important to know when the file was created especially when you document your servers regularly.

# Create timestamp
$timestamp = Get-Date -f yyyyddMMHHmmss # Set the destination$outputFile = $destination + '\MachineInformation_' + ($server).ToUpper() + '_' + ($instance).ToUpper() + '_' +$timestamp + '.xlsx'


If you want to change selection, open document below and click on "Move attachment"

Documenting SQL Server with PowerShell - Simple Talk
6 7 8 9 # Make up the target in case we have a default instance if(($instance -eq '') -or (($instance).ToUpper() -eq 'MSSQLSERVER')) { $target =$server } else { $target = "$server\$instance" } <span>The next section of code specifies the details of the output Excel file. It will take the name of the server, the name of the instance and put a timestamp on the file. The timestamp is in the file is important to know when the file was created especially when you document your servers regularly. 1 2 3 4 5 # Create timestamp$timestamp = Get-Date -f yyyyddMMHHmmss # Set the destination $outputFile =$destination + '\MachineInformation_' + ($server).ToUpper() + '_' + ($instance).

#### Summary

status measured difficulty not learned 37% [default] 0

No repetitions