package winrm

import 

// Shell is the local view of a WinRM Shell of a given Client
type Shell struct {
	client *Client
	id     string
}

// Execute command on the given Shell, returning either an error or a Command
//
// Deprecated: user ExecuteWithContext
func ( *Shell) ( string,  ...string) (*Command, error) {
	return .ExecuteWithContext(context.Background(), , ...)
}

// ExecuteWithContext command on the given Shell, returning either an error or a Command
func ( *Shell) ( context.Context,  string,  ...string) (*Command, error) {
	 := NewExecuteCommandRequest(.client.url, .id, , , &.client.Parameters)
	defer .Free()

	,  := .client.sendRequest()
	if  != nil {
		return nil, 
	}

	,  := ParseExecuteCommandResponse()
	if  != nil {
		return nil, 
	}

	 := newCommand(, , )

	return , nil
}

// Close will terminate this shell. No commands can be issued once the shell is closed.
func ( *Shell) () error {
	 := NewDeleteShellRequest(.client.url, .id, &.client.Parameters)
	defer .Free()

	,  := .client.sendRequest()
	return 
}