To export historical grades in PowerSchool navigate to DDE (Start Page > System Administrator > Page and Data Management > Direct Database Export (DDE) )
Select the "Stored Grades (31)" table:
Then search for the grades that you want. You can search by store code and by term ID, term ID's are 2700 for 2017-18 2800 for 2018-19 and so on. So if you searched for >=2700 and E1 you would get all exam 1 grades for 2017-18 school year.
Once you have your selection go to export records and select your fields.
An example of fields are here:
Student_Number
[1]First_Name
[1]Last_Name
Grade_Level
Course_Number
Course_Name
Grade
Percent