if you have space(s) in the path, you must either escape the space(s) or put the whole path into quotes.
Oddly the rm command with a wildcard (e.g. /Users/Desktop/Test/*) doesn’t work on my machine,
if the path is quoted, so the following script uses a repeat loop:
Caution: executing the script deletes permanently the contents of the chosen folder
set theFolder to (choose folder)
tell application "Finder" to set theItems to (get items of theFolder)
repeat with i in theItems
do shell script "rm -rf " & quoted form of POSIX path of (i as alias)