# New-AppLibAppDisk
Creates a new AppDisk.
Syntax
New-AppLibAppDisk [-AppDiskName] <String> -HostingUnitName <String> -DiskSizeMB <Int32> -PreparationMachine <String> [-Scope <String[]>] [-AppDiskDescription <String>] [-RunAsynchronously] [-PurgeJobOnSuccess] [-LoggingId <Guid>] [-AdminAddress <String>] [<CommonParameters>] New-AppLibAppDisk [-AppDiskName] <String> -HostingUnitUid <Guid> -DiskSizeMB <Int32> -PreparationMachine <String> [-Scope <String[]>] [-AppDiskDescription <String>] [-RunAsynchronously] [-PurgeJobOnSuccess] [-LoggingId <Guid>] [-AdminAddress <String>] [<CommonParameters>] New-AppLibAppDisk [-AppDiskName] <String> -SourceAppDiskUid <Guid> -PreparationMachine <String> [-AppDiskDescription <String>] [-RunAsynchronously] [-PurgeJobOnSuccess] [-LoggingId <Guid>] [-AdminAddress <String>] [<CommonParameters>] New-AppLibAppDisk [-AppDiskName] <String> -SourceAppDiskName <String> -PreparationMachine <String> [-AppDiskDescription <String>] [-RunAsynchronously] [-PurgeJobOnSuccess] [-LoggingId <Guid>] [-AdminAddress <String>] [<CommonParameters>]
Detailed Description
Lets you create a new AppDisk.
Related Commands
Parameters
Input Type
Return Values
System.Guid
When the RunAsynchronously identifier is specified, this GUID is returned and provides the task identifier### System.Management.Automation.PSCustomObject
   System.Management.Automation.PSCustomObject This object provides details of the task that was run and contains the following information:
TaskId 
    In case of failure, the following errors can result.
    Error Codes
    -----------
    JobCreationFailed
    The requested task could not be started.
    DatabaseError
    An error occurred in the service while attempting a database operation.
    DatabaseNotConfigured
    The operation could not be completed because the database for the service is not configured.
    ServiceStatusInvalidDb
    An error occurred in the service while attempting a database operation. Communication with the database failed
    for various reasons.
    CommunicationError
    An error occurred while communicating with the service.
    InvalidParameterCombination
    Both PurgeJobOnSuccess and RunAsynchronously were specified. When running asynchronously, the cmdlet terminates before the job does, so it cannot clean up the completed job.
    PermissionDenied
    The user does not have administrative rights to perform this operation.
    ConfigurationLoggingError
    The operation could not be performed because of a configuration logging error.
    ScopeNotFound
    One or more of the scopes nominated for the new AppDisk do not exist.
    ExceptionThrown
    The cmdlet is associated with a task of type NewAppDisk, and while active will move through the following operations (CurrentOperation field)
    ValidatingInputs
    ConsolidatingMasterImage
    PreparingMasterImage
    ReplicatingMasterImage
    CommittingScheme
Examples
EXAMPLE 1
C:\PS> New-AppLibAppDisk -AppDiskName MyAppDisk -HostingUnitName XenHu -DiskSizeMB 16384 -PreparationMachine S-1-5-21-2316621082-1546847349-2782505528-1165
          TaskId                              : 90e93b9d-a225-4701-ad50-fa1546af35ac
          AppDiskName                         : MyAppDisk
          AppDiskUid                          : d9ba6487-05f8-48ad-a178-1794605e2b8e
          Active                              : False
          DiskSizeMB                          : 16384
          DiskLocalUid                        : 7b4c01c4-72fa-4c80-913d-c6df785f4297
          DiskLocalVersion                    : 25118c6e-a737-4fb9-b4b3-121910a73160
          DateStarted                         : 17/11/2015 08:22:22
          LastUpdateTime                      : 17/11/2015 09:10:18
          DateFinished                        : 17/11/2015 09:10:18
          Type                                : NewAppDisk
          Metadata                            : {}
          TaskState                           : Finished
          TaskStateInformation                :
          TaskProgress                        : 100
          TerminatingError                    :
          RemoteTaskId                        : d2127904-a149-4dce-ae82-f9671a53f6fd
          HostingUnitName                     : XenHU
          HostingUnitUid                      : 01a4a008-8ce8-4165-ba9c-cdf15a6b0501
          Host                                : MyHost
          VirtualDiskId                       : 7ce3c9a5-2888-45ba-8629-398f9e4eba7d
          CurrentOperation                    :
          ActiveElapsedTime                   : 2786
          ReservedMachineSid                  : S-1-5-21-2316621082-1546847349-2782505528-1165
Description
-----------
Creates a new 16Gb AppDisk with the name "MyAppDisk" using the hosting unit "XenHu", using the preparation machine "S-1-5-21-2316621082-1546847349-2782505528-1165".
EXAMPLE 2
C:\PS> New-AppLibAppDisk -AppDiskName MyUpdatedAppDisk -AppDiskDescription "Includes new applications" -SourceAppDisk MyAppDisk -PreparationMachine S-1-5-21-2316621082-1546847349-2782505528-1165 -RunAsynchronously
          Guid
          ----
          6dd85fec-96cf-46b1-9cd4-d8ba7d06e85b
Description
-----------
Asynchronously creates a new AppDisk "MyUpdatedAppDisk" from "MyAppDisk", using the preparation machine "S-1-5-21-2316621082-1546847349-2782505528-1165". To get the task details, use Get-AppLibTask -TaskID 
i.e.
C:\PS>Get-AppLibTask -TaskID 6dd85fec-96cf-46b1-9cd4-d8ba7d06e85b
TaskId                              : 6dd85fec-96cf-46b1-9cd4-d8ba7d06e85b AppDiskName                         : MyUpdatedAppDisk AppDiskUid                          : 3b9c6b62-be1e-467b-9cb4-025ad9cba916 Active                              : False DiskSizeMB                          : DiskLocalUid                        : 7b4c01c4-72fa-4c80-913d-c6df785f4297 DiskLocalVersion                    : a23f8bae-dedf-433f-8908-025144ff4f81 DateStarted                         : 23/11/2015 12:09:53 LastUpdateTime                      : 23/11/2015 13:01:26 DateFinished                        : 23/11/2015 13:01:26 Type                                : NewAppDisk Metadata                            : {} TaskState                           : Finished TaskStateInformation                : TaskProgress                        : 100 TerminatingError                    : RemoteTaskId                        : 0ab9e8ed-1ded-4831-80c3-9cf84e752528 HostingUnitName                     : XenHU HostingUnitUid                      : 01a4a008-8ce8-4165-ba9c-cdf15a6b0501 Host                                : MyHost VirtualDiskId                       : 4c245ff7-5cdd-4aac-a854-1e101e23d1f6 CurrentOperation                    : ActiveElapsedTime                   : 3079 ReservedMachineSid                  : S-1-5-21-2316621082-1546847349-2782505528-1165
