I have a Javascript value in my Webpart and I want to use this value in my PowerShell script! Is it possible?
JAVASCRIPT CODE:
function RetrieveLog() {
var getItemsUrl = "/_api/Web/Lists/GetByTitle('" + ListName +"')/items?$select= ID,Title,LastDD,Current_x0020_DD_x0020_status&$orderby=Date1 desc&$top=1";
var promise = $.ajax({
url: _spPageContextInfo.webAbsoluteUrl + getItemsUrl,
type: "GET",
headers: {
"accept": "application/json;odata=verbose",
},
success: function (data) {
ArrayRetrieved = data.d.results;
if (ArrayRetrieved.length > 0) {
console.log(ArrayRetrieved);
//LICENSES
for (var i = 0; i < ArrayRetrieved.length; i++) {
if (ArrayRetrieved[i].Current_x0020_DD_x0020_status == "Signed-off")
$("#LastDD").text(moment(ArrayRetrieved[i].LastDD).format('DD MMM YYYY'));
}
}
},
error: function (error) {
console.log("Error on Retrieve log");
console.log(JSON.stringify(error));
}
});
}
For this, I want to get the value of $("#LastDD") in PowerShell.