-
Notifications
You must be signed in to change notification settings - Fork 4
New UniFiConfig
author: Joerg Hochwald category: UNIFITOOLING external help file: UniFiTooling-help.xml layout: post Module Name: UniFiTooling online version: https://github.com/jhochwald/UniFiTooling/raw/master/docs/New-UniFiConfig.md schema: 2.0.0 tags: OnlineHelp PowerShell timestamp: 2019-01-14 title: New-UniFiConfig
Creates the UniFi config JSON file
New-UniFiConfig [[-UniFiUsername] <String>] [[-UniFiPassword] <String>] [[-UniFiProtocol] <String>]
[[-UniFiSelfSignedCert] <Boolean>] [[-UniFiHostname] <String>] [[-UniFiPort] <Int32>] [[-Path] <String>]
[-force] [-WhatIf] [-Confirm] [<CommonParameters>]
Creates the UniFi config JSON file. If no input is given it creates one with all the defaults.
New-UniFiConfig
New-UniFiConfig -UniFiUsername 'unfi.admin.user' -UniFiPassword 'mySuperSecretPassworHere' -UniFiProtocol 'https' -UniFiSelfSignedCert $true -UniFiHostname 'unifi.contoso.com' -UniFiPort '8443' -Path '.\UniFiConfig.json'
New-UniFiConfig -UniFiUsername 'unfi.admin.user' -UniFiPassword 'mySuperSecretPassworHere' -UniFiProtocol 'https' -UniFiSelfSignedCert $true -UniFiHostname 'unifi.contoso.com' -UniFiPort '8443' -Path '.\UniFiConfig.json' -force
The login of a UniFi User with admin rights
Type: String
Parameter Sets: (All)
Aliases: enUniFiUsername
Required: False
Position: 2
Default value: Unfi.admin.user
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False
The password for the user given above. It is clear text for now. I know... But the Ubiquiti UniFi Controller seems to understand plain text only.
Type: String
Parameter Sets: (All)
Aliases: enUniFiPassword
Required: False
Position: 3
Default value: MySuperSecretPassworHere
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False
Valid is http and https. default is https Please note: http is untested and it might not even work!
Type: String
Parameter Sets: (All)
Aliases: enUniFiProtocol
Required: False
Position: 4
Default value: Https
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False
If you use a self signed certificate and/or a certificate from an untrusted CA, you might want to use true here. Default is FALSE
Type: Boolean
Parameter Sets: (All)
Aliases: enUniFiSelfSignedCert
Required: False
Position: 5
Default value: False
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False
The Ubiquiti UniFi Controller you want to use. You can use a Fully-Qualified Host Name (FQHN) or an IP address.
Type: String
Parameter Sets: (All)
Aliases: enUniFiHostname
Required: False
Position: 6
Default value: Unifi.contoso.com
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False
The port number that you have configured on your Ubiquiti UniFi Controller. The default is 8443
Type: Int32
Parameter Sets: (All)
Aliases: enUniFiPort
Required: False
Position: 7
Default value: 8443
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False
Where to safe the JSON config. Default is the directory where you call the function. e.g. .\UniFiConfig.json
Type: String
Parameter Sets: (All)
Aliases: enConfigPath, ConfigPath
Required: False
Position: 8
Default value: .\UniFiConfig.json
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False
Replaces the contents of a file, even if the file is read-only. Without this parameter, read-only files are not changed.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: 9
Default value: False
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Prompts you for confirmation before running the cmdlet.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
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).
Just an helper function to create a JSON config